Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
field system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Aug 2009 at 00:46 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
yched commentedWrong copy/paste, previous patch added the index on 'entity_id' twice.
Comment #2
yched commentedSorry, try again.
Comment #3
catchyched beat me to it opening the issue, subscribing.
Comment #4
yched commentedFound another bug, so I figured it was time to run the tests before posting a patch :-p.
This one passes field_attach_query tests.
Comment #5
yched commentedRemoves crufty code.
Trying to provide quick patches late at night only makes me look like an *ss and flood poor test bot. We should be there now :-p.
Comment #6
catchBefore:
After:
Better, still not using an index though.
Comment #7
yched commentedStrange, all columns used in the WHERE should be indexed now. Can you check the actual data table and see what are the indexes there ?
+ (sorry to add) Just applying the patch won't add the indexes on the table for an existing field, obviously. Testing an existing benchmark setup would require creating the indexes manually.
Or is MySQL chosing to use the primary key (which again, I'm not sure we need anymore) instead of the individual indexes that would be more efficient ?
Comment #8
catchI did a re-install of field_sql_storage.module, then upgraded my taxonomy data with the latest patch from that issue - so all the indexes should be there afaik, although I'll double check.
It's possible we need a composite index covering both the where and order by, although if the primary key covers that I dunno.
I thought it might be the join, but I get where in extra without that too.
Comment #9
yched commentedI did not try with the taxo_node_* patch, but the equivalent query on field 'body' shows no extra (querying on 'format' column, which is indexed)
Comment #10
catch@yched - from the show indexes, it looks like there's no cardinality in the table you're running the explain on. Could you try with some dummy content and confirm if it's the same?
Comment #11
yched commentedSorry, I had only one record in the table :-p. With 2 records, 'using where' shows up.
But it seems it shows up whenever there are more than 2 columns in the WHERE clause and no index for all those columns as a whole, so I'm not sure we can do better.
Comment #12
yched commentedPS: and the query in my #9 should read
(new query after the patch)
Comment #13
catchOK let's do this and look at multiple-column index support either as a follow-up in this issue or a new one, it's already an improvement.
Comment #14
catchSchema changes are apparently API changes - while this would have to go in post-freeze anyway, it'll also help some other patches out.
Comment #15
dries commentedI wonder if we could be a little bit more verbose here.
This review is powered by Dreditor.
Comment #16
yched commentedSure, what about this ?
Comment #17
dries commentedCommitted to CVS HEAD. Thanks.