Hi,

If you have that date column in your where clause for example:

SELECT ...... FROM ..... WHERE tstamp > NOW() - INTERVAL 1 WEEK;

Then it's essential to index that column to speed up a table with lots of data.

On a table with many rows, an index on a timestamp column is invaluable.  
However, I should point out that having an index on a column does add a small 
performance overhead to inserts and updates so if you're not going to use it in 
your where clauses then there's not much point in adding it.

Cheers,

Andrew

-----Original Message-----
From: Cantwell, Bryan [mailto:bcantw...@firescope.com] 
Sent: 24 April 2009 22:56
To: mysql@lists.mysql.com
Subject: Index time columns?

I have a debate with someone about indexes on time columns.
So I ask the community, should you put an index on a timestamp column of a 
table? 
Thanks...

Reply via email to