Opened 10 months ago

Last modified 10 months ago

#28661 new New feature

Auto-truncate indexes on MySQL when max index size is reached

Reported by: Claude Paroz Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


We have been hit several times in Django by this MySQL limitation when wanting to extend the length of some indexed char fields. One example is #19515.

I suggest to automatically limit indexes when the size of the indexed field is too long to be completely indexed by MySQL. This auto-truncation would be limited to single-indexed fields, because I don't see trivial automatic rules when more than one field is indexed (proportional shortening, maybe?).

Change History (3)

comment:1 Changed 10 months ago by Claude Paroz

Has patch: set

comment:2 Changed 10 months ago by Claude Paroz

Also note that this is a step toward activating the utf8mb4 charset by default (#18392).

comment:3 Changed 10 months ago by Tim Graham

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