Home » Performance » MySQL » INT vs. TIMESTAMP data types
INT vs. TIMESTAMP data types [message #2934] Fri, 11 April 2008 16:26 Go to previous message
Speeple  is currently offline Speeple
Messages: 91
Registered: August 2006
Member
Hi,

Currently for a blog platform I have:

year=YEAR
month=TINYINT
day=TINYINT
timestamp=INT

I was contemplating using the TIMESTAMP type.

To get previous usage like yearly monthly etc archives I would do:

WHERE author=4 AND YEAR(timestamp)=2008 AND MONTH(timestamp)=4

Would this utilize an index on INDEX(author, timestamp) or would the functions YEAR() and MONTH() which extract kill the index usage?

Cheers!


Martin Gallagher | Speeple: The latest news

Read Message
Read Message
Read Message
Read Message
Previous Topic:ndb size
Next Topic:Tweak Innodb parameters
Goto Forum:

  


Current Time: Fri Jul 10 03:20:28 EDT 2009

Total time taken to generate the page: 0.05831 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.