Opened 3 days ago

Closed 3 days ago

Last modified 3 days ago

#36046 closed Cleanup/optimization (wontfix)

Create an index on the combination of ForeignKeys in the ManyToManyField through table?

Reported by: Willem Van Onsem Owned by:
Component: Database layer (models, ORM) Version: 5.1
Severity: Normal Keywords:
Cc: Mariusz Felisiak Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As this SO question points out, Django apparently does not create an index on the *combination* of the two ForeignKeys. It might be an idea to automatically do this?

Change History (2)

comment:1 by Mariusz Felisiak, 3 days ago

Resolution: wontfix
Status: newclosed
Type: UncategorizedCleanup/optimization

Django automatically adds a unique constraint for these two fields which is effectively an index, there is no need to add another one.

comment:2 by Mariusz Felisiak, 3 days ago

Cc: Mariusz Felisiak added
Note: See TracTickets for help on using tickets.
Back to Top