[wp-trac] [WordPress Trac] #34873: dbDelta PRIMARY KEY Single Space Recreates Index
WordPress Trac
noreply at wordpress.org
Sun Dec 6 18:06:29 UTC 2015
#34873: dbDelta PRIMARY KEY Single Space Recreates Index
--------------------------+-----------------------------
Reporter: charlestonsw | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version: 3.5.1
Severity: normal | Keywords:
Focuses: performance |
--------------------------+-----------------------------
Reference ticket #10404.
This is to decompose the original ticket into components. May be fixed in
4.4. Needs testing.
----
If there is a double space after PRIMARY KEY the dbDelta method will
create the primary key and future comparisons match, reducing overhead
whenever dbDelta is called (on a plugin/theme update for example).
On a large table, hundreds of thousands of records, this can be a notable
performance penalty when updating a plugin/theme.
This avoids performance penalties:
{{{
PRIMARY KEY my_pkey ( id ),
}}}
This recreates the index:
{{{
PRIMARY KEY my_pkey ( id ),
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34873>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list