On Tue, Oct 07, 2008 at 12:51:49AM +0300, Nick Keefen wrote:
> hi Jeff.
>
> I'm impressed. I figured that was the optimizer's fault and tried to
> change its depth but it did not help. STRAIGHT_JOIN gives the perfect
> performance of split seconds!
>
> Unfortunately it might be tricky for me to modify my webapp (i'm more of
> a system administrator and am uncomfortable with the idea of modifying
> the client's code). Is there any way to make the query optimizer work
> correctly?
Not without modifying the query. MySQL doesn't have a way to save/change
query plans for specific queries.
The best thing would be to contact the app authors and point this out to them.
We have work in progress on getting index statistics to mysql optimiser
that should dramatically improve things. Although this isn't a solution
to your problem today, it may well be in the future.
--
Stewart Smith