Opened 8 years ago

Closed 8 years ago

#3142 closed enhancement (fixed)

[patch] Faster many-to-many field assignment

Reported by: mitakummaa@… Owned by: adrian
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: UI/UX:

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@… 8 years ago.
Patch against trunk r4201

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by mitakummaa@…

Patch against trunk r4201

comment:1 Changed 8 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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