On Thu, 2004-02-19 at 08:24, Alex Greg wrote: > I have a select query which is selecting all records in a table (which has > around 8,000,000 rows in). "time" is a field of type "time". Should I be using > <= and >= or BETWEEN to find records in a certain range? Which does MySQL > optimise for?
I can not speak to specifics in the code, but I have 150 million row InnoDB table that has an int field that stores a unix_timestamp() and I've gotten slightly better performance using BETWEEN rather than AND, but this is largely anecdotal, as I don't have hard numbers. Your best bet would be to test performance yourself. Be sure you are using an index on that column in your query (verify that with explain) -- using an index will make the most difference, of course. -- Andy Bakun: get used to it <[EMAIL PROTECTED]> -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]