#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 , 11 months ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
| Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 11 months ago
| Cc: | added |
|---|
Note:
See TracTickets
for help on using tickets.
Django automatically adds a unique constraint for these two fields which is effectively an index, there is no need to add another one.