password_policy makes use of the mysql TEXT column type on the 'policy' database column. Because of this, database lookups that include the password_policy table are unable to use MySQL's in memory temporary tables due to the inclusion of a TEXT field, and so temporary tables must be created on disk for each of these lookups. This results in a considerable performance issue as on-disk temporary tables can have a massive effect on performance. I don't see any need for this column to be of type TEXT. Wouldn't a varchar(255) suffice? As far as I can tell, you are only storing serialised settings data in there - that shouldn't be too large (my policy certainly takes up less than 255 characters)
Please consider changing this column to varchar which will allow MySQL to make proper use of indexes and in memory temporary tables.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | db_schema_fix_1.patch | 1.79 KB | afreeman |
Comments
Comment #1
afreeman commentedI've verified it's possible to create strings longer than 255 characters but as of 5.0.3 mysql supports varchar() of greater than 255 characters. This patch includes a fix to the schema declaration, an update function and should also resolve #703938: password policy schema mismatch issue
Comment #2
afreeman commentedComment #3
deekayen commentedUse the schema update functions instead of update_sql and add the default back in.
Comment #4
deekayen commentedI made the relevant changes and committed to HEAD.