RE: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
-Original Message- From: Aftab Khan [mailto:[EMAIL PROTECTED] Sent: 05 January 2006 11:03 To: Javier Diaz Subject: Re: Problems with indexes on Date/DateTime fields Is not the second quary doing a full table scan? The parser may find this better than using the Index. --- Javier Diaz

RE: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
if that is the case we will need to re-visit a few queries Thx Javier -Original Message- From: Aftab Khan [mailto:[EMAIL PROTECTED] Sent: 05 January 2006 11:25 To: Javier Diaz Subject: RE: Problems with indexes on Date/DateTime fields I agree. Some time full table scan is faster than using

Re: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Jigal van Hemert
Javier Diaz wrote: I would like to know if there is any problem which cause Mysql to not use date indexes at least you use the = operator, because if that is the case we will need to re-visit a few queries If you do a select instead of a delete, will the index be used? (You can check

RE: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Javier Diaz
] Are valid for the equivalent DELETE FROM TABLE-X WHERE [CONDITIONS] Thanks a lot for your help Javier -Original Message- From: Jigal van Hemert [mailto:[EMAIL PROTECTED] Sent: 05 January 2006 14:39 To: Javier Diaz Cc: Aftab Khan; mysql@lists.mysql.com Subject: Re: Problems with indexes on Date

Re: Problems with indexes on Date/DateTime fields

2006-01-05 Thread Jigal van Hemert
Javier Diaz wrote: EXPLAIN SELECT * FROM process_times WHERE date = date_sub(now(), INTERVAL 2 day) possible_keysdate_idx,date_proc_idx/possible_keys key(NULL)/key rows10778561/rows EXPLAIN SELECT * FROM process_times WHERE date = date_sub(now(), INTERVAL 2 day)