Im trying to speed up a query.

select 
project_id 
from 
timesheet ts 
where 
ts.del is null 
and signoff = 'A'

The output of explain is detailed below.

+----+-------------+-------+------+-------------------------+------+--------
| id | select_type | table | type | possible_keys           | key  | key_len
+----+-------------+-------+------+-------------------------+------+--------
|  1 | SIMPLE      | ts    | ALL  | signoff,del,del_signoff | NULL |    NULL

+----+-------------+-------+------+-------------------------+------+--------
| ref  | rows | Extra       |
+----+-------------+-------+------+-------------------------+------+--------
| NULL | 3907 | Using where |
+----+-------------+-------+------+-------------------------+------+--------

An index exists on all three columns referred to, in addition to a
combination of del and signoff.

The indexes are listed as possible keys, but none used by the query; key =
null. Can anyone suggest why? How can I optimise this?

Thanks

Terry 



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

Reply via email to