On 20 Aug 2003 at 15:08, Tom O'Neill (MySQL User) wrote:

> Is there any difference in speed between the following select
> statements?
> 
> SELECT yada,yda FROM test WHERE id IN(1,2,3) 
> 
> OR
> 
> SELECT yada,yda FROM test WHERE (id =1 or id = 2 or id =3) 

You can put EXPLAIN in front of your SELECT statement to see how 
MySQL plans to execute it.  Those seem to be treated identically in 
version 4.0.14, but it's possible that the second one wasn't as 
optimized in some earlier version.

Documentation on EXPLAIN is here:

http://www.mysql.com/doc/en/EXPLAIN.html

-- 
Keith C. Ivey <[EMAIL PROTECTED]>
Tobacco Documents Online
http://tobaccodocuments.org


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to