Hi David, all! David Sparks wrote:
I have a query that is taking days to complete (not good). If I change the query so that it selects less rows it runs fast.
I fear I have no decisive hint for this (sorry), but still ...
[[...]] mysql> select count(*) from msgs where message_id > 1120000000 and message_id < 1120000111; [[...]]
Have you considered using BETWEEN? IMNSHO, this will both improve the readability of your SQL statement and at the same time help the optimizer (and avoid typing errors!). Yes, logically it is equivalent, but in C you also write len++; or len+= 1; and not len= len + 1; Regards, Jörg -- Joerg Bruehe, Senior Production Engineer MySQL AB, www.mysql.com Office: (+49 30) 417 01 487 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]