On Saturday 01 March 2003 01:26, Henning Schulzrinne wrote:

> Both email columns have the same format (varchar) and are indexed
> individually:
>
>   describe SELECT person FROM person WHERE email1='foo' OR email2='foo';
> +--------+------+---------------+------+---------+------+-------+----------
>---+
>
> | table  | type | possible_keys | key  | key_len | ref  | rows  | Extra
>
> +--------+------+---------------+------+---------+------+-------+----------
>---+
>
> | person | ALL  | email1,email2 | NULL |    NULL | NULL | 57051 | Using
>
> where |
> +--------+------+---------------+------+---------+------+-------+----------
>---+

[skip]

> I'm curious why this is. (In general, I have been surprised by how often
> indices are not used even if they exist.)

it's know behaviour and described in the manual:
        http://www.mysql.com/doc/en/MySQL_indexes.html
        http://www.mysql.com/doc/en/Searching_on_two_keys.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to