pjau
pjau

Reputation: 925

Which is quicker when indexed. INT (10) or Timestamp in MySQL

I was just wondering which field type would be the best solution for storing a timestamp in a MySQL database.

Currently I store timestamps in an INT (10) field and insert the time by doing UNIX_TIMESTAMP(). If I was to use a timestamp field would it be slower or quicker when indexed? I know both fields use 4 bytes.

Upvotes: 0

Views: 757

Answers (1)

Khorkrak
Khorkrak

Reputation: 4019

They're both implemented by a 4 byte integer so the indexes should perform equally well.

Upvotes: 2

Related Questions