[Django] #35000: Skip redundant defaults to allow INSTANT longtext (among others) column addition in MySQL

24 views
Skip to first unread message

Django

unread,
Nov 29, 2023, 10:04:07 AM11/29/23
to django-...@googlegroups.com
#35000: Skip redundant defaults to allow INSTANT longtext (among others) column
addition in MySQL
-------------------------------------+-------------------------------------
Reporter: Tobias | Owner: nobody
Krönke |
Type: | Status: new
Uncategorized |
Component: | Version: 4.2
Migrations | Keywords: mysql, migrations,
Severity: Normal | performance
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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

--
Ticket URL: <https://code.djangoproject.com/ticket/35000>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 29, 2023, 2:47:20 PM11/29/23
to django-...@googlegroups.com
#35000: Skip redundant defaults to allow INSTANT longtext (among others) column
addition in MySQL
-------------------------------------+-------------------------------------
Reporter: Tobias Krönke | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Migrations | Version: 4.2
Severity: Normal | Resolution:
Keywords: mysql, migrations, | Triage Stage: Accepted
performance |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/35000#comment:1>

Django

unread,
Nov 30, 2023, 4:34:08 AM11/30/23
to django-...@googlegroups.com
#35000: Skip redundant defaults to allow INSTANT longtext (among others) column
addition in MySQL
-------------------------------------+-------------------------------------
Reporter: Tobias Krönke | Owner: Tobias
Type: | Krönke
Cleanup/optimization | Status: assigned

Component: Migrations | Version: 4.2
Severity: Normal | Resolution:
Keywords: mysql, migrations, | Triage Stage: Accepted
performance |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: nobody => Tobias Krönke
* needs_better_patch: 0 => 1
* status: new => assigned
* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/35000#comment:2>

Django

unread,
Dec 12, 2023, 12:05:23 AM12/12/23
to django-...@googlegroups.com
#35000: Skip redundant defaults to allow INSTANT longtext (among others) column
addition in MySQL
-------------------------------------+-------------------------------------
Reporter: Tobias Krönke | Owner: Tobias
Type: | Krönke
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 4.2
Severity: Normal | Resolution:
Keywords: mysql, migrations, | Triage Stage: Accepted
performance |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/35000#comment:3>

Django

unread,
Dec 14, 2023, 5:10:13 AM12/14/23
to django-...@googlegroups.com
#35000: Skip redundant defaults to allow INSTANT longtext (among others) column
addition in MySQL
-------------------------------------+-------------------------------------
Reporter: Tobias Krönke | Owner: Tobias
Type: | Krönke
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 4.2
Severity: Normal | Resolution:
Keywords: mysql, migrations, | Triage Stage: Ready for
performance | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/35000#comment:4>

Django

unread,
Dec 14, 2023, 6:07:56 AM12/14/23
to django-...@googlegroups.com
#35000: Skip redundant defaults to allow INSTANT longtext (among others) column
addition in MySQL
-------------------------------------+-------------------------------------
Reporter: Tobias Krönke | Owner: Tobias
Type: | Krönke
Cleanup/optimization | Status: closed
Component: Migrations | Version: 4.2
Severity: Normal | Resolution: fixed

Keywords: mysql, migrations, | Triage Stage: Ready for
performance | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"d6c868a184e01f44302e8d31130fe1321208a6af" d6c868a1]:
{{{
#!CommitTicketReference repository=""
revision="d6c868a184e01f44302e8d31130fe1321208a6af"
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.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/35000#comment:5>

Reply all
Reply to author
Forward
0 new messages