MySQL Forums
Forum List  »  Optimizer & Parser

Re: indices not used
Posted by: Martin Luy
Date: June 22, 2010 01:15AM

quotes were missing again... sorry...

EXPLAIN(SELECT * FROM `products` WHERE c1 = '22' AND c2 = 5 AND c3 = 2 ORDER BY factor DESC)

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE products ref keyname keyname 22 const,const,const 46397 Using where



SHOW CREATE TABLE products;

phpMyAdmin 2.9.1.1-Debian-8 / MySQL 5.0.51a-9-log

CREATE TABLE `products` (
`id` bigint(20) NOT NULL,
`c1` varchar(3) default NULL,
`c2` int(4) default NULL,
`c3` int(4) default NULL,
PRIMARY KEY (`id`),
KEY `keyname` (`c1`,`c2`,`c3`,`factor`)
) ENGINE=MyISAM AUTO_INCREMENT=106221415 DEFAULT CHARSET=utf8


Well, now it works. Thanks for your help!
Martin

Options: ReplyQuote


Subject
Views
Written By
Posted
2766
May 25, 2010 04:13AM
1591
May 25, 2010 12:07PM
1490
May 27, 2010 08:35PM
1433
June 19, 2010 03:35AM
1396
June 21, 2010 06:25PM
Re: indices not used
1336
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.