On Mon, Apr 26, 2004 at 05:17:45PM -0500, Boyd E. Hemphill wrote:
> I thought I heard at the conference that the optimizer only uses a one
> index per table in a query regardless of the number of indexes on the
> table.  
>
> Is this true?

Yes.

The only exception is in a UNION, but that's best thought of as
multiple queries anyway.

> Are there any more details regarding the use of indexes I can find
> in the documentation?  Specifically how the optimizer picks which
> index to use?  I read through 7.2.4 and several other sections but
> no luck.

The optimizer looks at the available indexes and attempts to find the
one that will require the least amount of work, which usually
translates to reading the fewest records to find a match.

Have you run your queries thru EXPLAIN to see which keys is considers
and which one it chooses?

Jeremy
-- 
Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/

[book] High Performance MySQL -- http://highperformancemysql.com/

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

Reply via email to