Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
taxonomy.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Dec 2009 at 18:25 UTC
Updated:
3 Jan 2014 at 01:08 UTC
Jump to comment: Most recent
Comments
Comment #1
brianV commentedJust to clarify, example query is from D6, and should rightly be:
D6:
D7's query is a bit more complex, with a few JOINS, but still needs the index on the 'name' column.
Comment #2
Anonymous (not verified) commentedThere are already 2 indexes on the name column, but they're not being used by these queries because the fields are 2nd and 3rd order in a multi-column index.
Do we need an index on name alone? Or can we swap the order of the vid_name index to put name first? If we can't swap, should we separate the vid_name index to be 2 indexes on both fields separately?
We need some DB folks on this. Thanks for bringing it up, brianV.
Comment #3
catchThe reason it doesn't have an index in D6 is because LOWER() queries never use an index anyway. See #279851: Replace LOWER() with db_select() and LIKE() where possible for background.
However now we use LIKE() in D7, and this doesn't use wildcards either, so it should use an index - very nice find.
I'm not aware of anywhere in core where the vid, name index is used - I'd rather see us drop that as well as using the name one (unless I've got that wrong).
Comment #4
catchI found where vid, name is used - in taxonomy_autocomplete(). So just adding the extra index here is fine, RTBC.
Comment #5
dries commentedCommitted to CVS HEAD. Thanks.