i have a table which has big int column used for storing the time stamp.The time stamp value which we are getting from our application is 13 digit number like 1280505757693.And there are many rows in this table right now probably more than half a million entries.Should i use Index on timestamp column or not ???? Any suggestions ?
A:
Are the numbers contiguous or do they contain encoded information in some form? By this I mean is 1280505757693 + 1 one tick beyond 1280505757693? If so, then you can create an index and it will be useful for equal to matches and range matches; otherwise, only for equal to matches.
If you are keeping timestamps in your database you may wish to consider MySQL's TIMESTAMP
and DATETIME
types; see here http://dev.mysql.com/doc/refman/5.1/en/datetime.html . You can certainly create indexes on those.
Brian Hooper
2010-08-26 10:40:37