Corin,
Thursday, October 17, 2002, 3:09:08 PM, you wrote:
CL> i have the following problem. I have a table wherey to_id
CL> and owner_id are of type unsigned int not null and both
CL> are normal indexes. Unluckily a query like:
CL> ------
CL> EXPLAIN SELECT * FROM `telegramme` WHERE to_id = 3157 or owner_id = 3157
CL> ------
CL> returns very bad results:
CL> ------
CL> table type possible_keys key key_len ref rows Extra
CL> telegramme ALL to_id,owner_id NULL NULL NULL 11488 where used
CL> ------
CL> how could this be optimized or is this a bug of mysql, because the
CL> indexes exist but are not used (even if specified with use index(..)) ?!
How many rows there are in table `telegramme`? When MySQL needs to access to more
that 30% records in the table, it doesn't use an index:
http://www.mysql.com/doc/en/MySQL_indexes.html
--
For technical support contracts, goto https://order.mysql.com/?ref=ma02-010c
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