WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#35109 new enhancement

Add Online DDL support to dbDelta

Reported by: pento Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Database Keywords: needs-patch needs-unit-tests
Focuses: performance Cc:

Description

Since MySQL 5.1, a bunch of table level operations can be done in an asynchronous manner.

We can add support for this by adding ALGORITHM=INPLACE to the ALTER TABLE query, but the fun part is that this algorithm isn't supported for all types of operations.

So, we have a couple of options:

  • Keep an array of what operations can be done online in each MySQL and MariaDB version, which will need to be updated for each new version of MySQL.
  • Try all ALTER queries with the algorithm flag, then catch any SQL errors and fall back to the old style if needed. This will need careful testing with old versions of MySQL, particularly.

https://dev.mysql.com/doc/refman/5.7/en/innodb-create-index-overview.html

Change History (3)

This ticket was mentioned in Slack in #core by chriscct7. View the logs.


2 years ago

#2 @chriscct7
2 years ago

@pento should this be punted, maybe early, to a future release?

#3 @pento
2 years ago

  • Milestone changed from 4.5 to Future Release

Yeah, I didn't get around to writing this.

Note: See TracTickets for help on using tickets.