Make WordPress Core

Opened 8 years ago

Last modified 5 years ago

#35109 new enhancement

Add Online DDL support to dbDelta

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


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.

Change History (3)

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

8 years ago

#2 @chriscct7
8 years ago

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

#3 @pento
8 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.