> Possibly because datestamp and 20041105 have different datatypes.
> There's an implicit data conversion required for the comparison, which
> in some cases prevents use of an index. Try writing '20041105' rather
> than 20041105 and see if that makes a difference.

Nope.. :-/

mysql> explain SELECT * FROM campaign_t WHERE datestamp < '20041105'\g
+------------+------+---------------+------+---------+------+--------+------------+
| table      | type | possible_keys | key  | key_len | ref  | rows   | Extra      |
+------------+------+---------------+------+---------+------+--------+------------+
| campaign_t | ALL  | datestamp     | NULL |    NULL | NULL | 438473 | where used |
+------------+------+---------------+------+---------+------+--------+------------+

I think someone's onto something though regarding the 'optimize'
command.

The above selection is actually a DELETE, and it results in about a 3%
deletion of the table per day.  This has been running for months (if not
years) with no optimization.  Is it possible that this table is so
fragmented?

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

Reply via email to