[wp-trac] [WordPress Trac] #34870: dbDelta Not Specifying Key Length Duplicate Indexes
WordPress Trac
noreply at wordpress.org
Tue Apr 4 18:10:37 UTC 2017
#34870: dbDelta Not Specifying Key Length Duplicate Indexes
--------------------------+--------------------------
Reporter: charlestonsw | Owner: pento
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.8
Component: Database | Version: 2.8.1
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses: performance
--------------------------+--------------------------
Comment (by johnjamesjacoby):
> dropping/creating is a slow process which we don't want to trigger
automatically.
This sounds ripe for optimization.
On installations like WordPress.com and WordPress.org, automatically re-
indexing will result in database lock lasting minutes to hours (been
there, done that, sorry Barry.) But for the majority of WordPress
installations (if the 80/20 rule approximately applies) this process
likely will not be very slow at all.
We could try to calculate the number of affected rows aside of `dbDelta()`
and set a reasonable default threshold where these kinds of alter's are
allowed to run automatically.
Something like:
{{{
define( 'DB_MAX_ALTERED_ROWS', 25000 );
}}}
If a database has more rows than the maximum number that can be alter'ed,
then throw a database error?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34870#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list