List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:October 19 2011 11:21am
Subject:Re: Is it possible to make this more efficient?
View as plain text  
----- Original Message -----
> From: "Sergei Petrunia" <psergey@stripped>
> 
> Create index on (importance, company_id)  (or
> (company_id,importance), should
> not matter). When that index is present, the query should use ref
> access on it using both key parts (if by some crazy reason it doesn't, use FORCE
> INDEX to make it to).  This way, you will be scanning as few rows as possible.

Umm... It might just be a matter of cardinality? :-) While the optimizer can be wrong at
times (and it's certainly worth checking that) it does usually pick the best choices.

-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
Thread
Is it possible to make this more efficient?Wayne W19 Oct
  • Re: Is it possible to make this more efficient?Sergei Petrunia19 Oct
    • Re: Is it possible to make this more efficient?Johan De Meersman19 Oct