Opened 3 years ago

Last modified 2 years 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: yes
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 (5)

comment:1 Changed 3 years ago by Claude Paroz

Has patch: set

comment:2 Changed 3 years ago by Claude Paroz

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

comment:3 Changed 3 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:4 Changed 2 years ago by Carlton Gibson

Triage Stage: AcceptedReady for checkin

comment:5 Changed 2 years ago by Tim Graham

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted
Note: See TracTickets for help on using tickets.
Back to Top