At 8:34 -0500 1/24/04, Larry Brown wrote:
in a select statement, is the order of elements in the where clause the
determining factor on what records are chosen first, second etc?

No. The optimizer examines the query to determine the most efficient way to execute the query. You can get information about how the optimizer views a SELECT statement by issuing it with the word EXPLAIN prepended:

EXPLAIN select fname from maintable where status=1 and dob > '2001-03-10';


for instance...


select fname from maintable where status=1 and dob > '2001-03-10';

does that mean that the records will first be checked for status creating a
pool of records with status=1 to then check for dob out of that pool or if
one of the fields is an index will it automatically use the index first or
does it use some other ordering methodology?

TIA

Larry



--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

MySQL Users Conference: April 14-16, 2004
http://www.mysql.com/uc2004/

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



Reply via email to