...

View Full Version : use / foce index



BubikolRamios
12-02-2011, 10:54 PM
Should that affect result of explain ?

It does not.
Neither it affect performance.

Old Pedant
12-02-2011, 11:29 PM
I'm sorry...I don't understand the question.

BubikolRamios
12-03-2011, 02:58 PM
One of my quryies is slow, so I run explain.

I get:



possible_keys key

mykey NULL


so the key is not used but it should be. Trying to force it has no effect, nor on result of explain nor speed of query

Old Pedant
12-03-2011, 08:59 PM
Ahh...I see.

It's not used because MySQL has decided--for reasons known only to its builders--the it won't be any faster to use it than to not use it.

I can't judge whether reorganizing the data would improve things, because you showed us no details.

I fought with MySQL many many times over stuff like this, and often the only solution is to actually make the query more complex so that MySQL can work on smaller pieces and so use the indexes efficiently.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum