MySQL Forums
Forum List  »  Optimizer & Parser

Re: indices not used
Posted by: Martin Luy
Date: May 25, 2010 12:07PM

The quotes were missing in the ean-query:

EXPLAIN(SELECT * FROM `products` WHERE isbn_13 > '9780000000000' AND isbn_13 < '9780000000002')

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE products range ean ean 42 NULL 1 Using where


But I didn't find the reason for the factor query. It doesn't work with "ORDER BY id", too (id is of type integer and the primary key column). In another table (which has much less rows), the respective index is used with a similar query:

EXPLAIN(SELECT * FROM orders ORDER BY customer_id DESC)

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders index NULL orders_customer_id 9 NULL 1061

Do I need to do "ALTER TABLE product ORDER BY factor", and do I still need "ORDER BY factor" in the query then?

Martin



Edited 1 time(s). Last edit at 05/25/2010 12:08PM by Martin Luy.

Options: ReplyQuote


Subject
Views
Written By
Posted
2766
May 25, 2010 04:13AM
Re: indices not used
1591
May 25, 2010 12:07PM
1490
May 27, 2010 08:35PM
1433
June 19, 2010 03:35AM
1396
June 21, 2010 06:25PM
1337
June 22, 2010 01:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.