List:General Discussion« Previous MessageNext Message »
From:Mladen Adamovic Date:March 11 2006 6:41pm
Subject:Re: Query Optimization Question
View as plain text  
Robert DiFalco wrote:
> In a previous database engine I was using an IN was more optimal than a
> <>. So, for example:
>  
>     SELECT * FROM table WHERE table.type IN (1,2,3);
>  
> Where the possible values of type are 0-3, was appreciably faster than:
>  
>     SELECT * FROM table WHERE table.type <> 0;
>   
IN should be faster implemented with both hash tables and BTREE's so 
nowadays it should also be faster than <> as all MySQL implementation 
AFAIK use those well known data structures for indexes.


>  
> I've been playing with the Query Browser and checking out the
> optimization documents and haven't been able to make a clear call on
> whether or not this is also the case with MySQL/InnoDB.
>  
> TIA,
>  
> R.
>  
>
>
>   

-- 
Mladen Adamovic
http://home.blic.net/adamm
http://www.shortopedia.com 
http://www.froola.com 


Thread
Query Optimization QuestionRobert DiFalco11 Mar
  • Re: Query Optimization QuestionMladen Adamovic11 Mar
  • Re: Query Optimization QuestionSGreen13 Mar
RE: Query Optimization QuestionRobert DiFalco13 Mar
  • RE: Query Optimization QuestionSGreen13 Mar
RE: Query Optimization QuestionRobert DiFalco13 Mar
Re: Query Optimization QuestionMichael Stassen14 Mar
Re: Query Optimization QuestionMichael Stassen14 Mar