#35000 closed Cleanup/optimization (fixed)

Skip redundant defaults to allow INSTANT longtext (among others) column addition in MySQL

Reported by: Tobias Krönke Owned by: Tobias Krönke
Component: Migrations Version: 4.2
Severity: Normal Keywords: mysql, migrations, performance
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

MySQL 8+ is capable of adding new columns instantly just by editing the meta information. It automatically chooses the fasted algorithm for ALTER TABLE statements (https://dev.mysql.com/doc/refman/8.0/en/alter-table.html), so I was wondering if the migration SQL code generated by django actually makes use of this.

PR is here: https://github.com/django/django/pull/17539
Original comment with workaround: https://code.djangoproject.com/ticket/27676#comment:8

Change History (5)

comment:1 by Mariusz Felisiak, 13 months ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by Mariusz Felisiak, 13 months ago

Needs tests: set
Owner: changed from nobody to Tobias Krönke
Patch needs improvement: set
Status: newassigned

comment:3 by Mariusz Felisiak, 13 months ago

Patch needs improvement: unset

comment:4 by Mariusz Felisiak, 12 months ago

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 12 months ago

Resolution: fixed
Status: assignedclosed

In d6c868a1:

Fixed #35000 -- Skipped declaring empty string defaults on BLOB/TEXT field on MySQL.

Empty string defaults are redundant on MySQL and prevent use of
ALGORITHM=INSTANT.

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