Opened 5 years ago

Closed 5 years ago

#30773 closed New feature (wontfix)

Support Algorithm parameter on MySQL migrations.

Reported by: mklauber Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: mysql
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

See: https://mysqlserverteam.com/mysql-8-0-innodb-now-supports-instant-add-column/

Mysql now supports (as of 8.0) a new ALGORITHM = INSTANT, that prevents long running DDL statements. It would be useful to be able to define this on migrations, to prevent table locking, without having to manually write every migration. Perhaps as an option on the database in the DATABASES setting dict?

Change History (2)

comment:1 by Simon Charette, 5 years ago

MySQL will use the best algorithm available by default if possible (INPLACE or INSTANT) so this option will only make the operation crash if the specified algorithm is not available. Given MySQL doesn't support transactional DDL this has the potential to cause more harm than good IMO.

I guess we could add support for algorithm to MySQL schema editor but as I mentioned above MySQL already picks the best algorithm it can and I can't see a reason for using COPY or INPLACE when INSTANT is supported.

Finally given we added AddIndexConcurrently to contrib.postgres this would probably belong in django-mysql.

Version 0, edited 5 years ago by Simon Charette (next)

comment:2 by Mariusz Felisiak, 5 years ago

Component: MigrationsDatabase layer (models, ORM)
Resolution: wontfix
Status: newclosed

I totally agree with Simon.

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