Opened 18 years ago

Closed 18 years ago

#3142 closed enhancement (fixed)

[patch] Faster many-to-many field assignment

Reported by: mitakummaa@… Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently code such as article.publications = list_of_n_publications uses n SELECTs. This simple patch adds all related m2m objects at once, thus reducing the amount of SELECTs to one.

Test coverage: Django tests in modeltests/many_to_many cover this area and they all pass.

Attachments (1)

faster_m2m_assignment.diff (781 bytes ) - added by mitakummaa@… 18 years ago.
Patch against trunk r4201

Download all attachments as: .zip

Change History (2)

by mitakummaa@…, 18 years ago

Attachment: faster_m2m_assignment.diff added

Patch against trunk r4201

comment:1 by Russell Keith-Magee, 18 years ago

Resolution: fixed
Status: newclosed

(In [4231]) Fixed #3142 -- Optimized the assignment of m2m and m2o relation sets. Thanks, (and well spotted!) mitakummaa@….

Note: See TracTickets for help on using tickets.
Back to Top