On 19 Jun 2003 at 16:18, Chris Boget wrote:

> Why isn't the key being used in the "c" (certificate) table?
> 
> SELECT DISTINCT a.uid, a.company, a.firstname, a.lastname 
> FROM master_info a, logins lsl, logins lc, certificate c WHERE 
> a.uid = lsl.uid AND lc.parent = lsl.uid AND lc.uid = c.uid AND 
> c.void <> 1 AND c.status IN 
> ('CP', 'MC', 'AIC', 'RP', 'VQ', 'NQ', 'LQ', 'RQ', 'NG', 'EP', 'AA',
> 'AD' ) AND lsl.active = "1" AND lsl.void = "0" ORDER BY company, uid

How do you think the key should be used?  You have a key on status, 
but you're asking for a wide range of status values.  Presumably 
MySQL thinks (probably correctly) that using the index to find a 
range of status values from 'AA' to 'VQ' is no faster than doing a 
full table scan.

I could be missing something, but if so it would help if you could 
explain how you expect the key to be used.

-- 
Keith C. Ivey <[EMAIL PROTECTED]>
Tobacco Documents Online
http://tobaccodocuments.org


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

Reply via email to