Ian McIntyre Silber
Ian McIntyre Silber

Reputation: 5663

Speedwise, which is better, datetime or timestamp?

My database currently uses datetime for time, and does a number of selects against them.

Would switching to timestamp field types make an impact on query speed?

Upvotes: 1

Views: 125

Answers (2)

swapnesh
swapnesh

Reputation: 26732

Timestamps in MySQL generally used to track changes to records, and are updated every time the record is changed. If you want to store a specific value you should use a datetime field.

Source --

Should I use field 'datetime' or 'timestamp'?

Upvotes: 0

Oleksi
Oleksi

Reputation: 13097

The best way to find out is the measure. It really depends on the kind queries you make, however I doubt this will make a noticeable performance difference in your overall program. You should use the one which most accurately describes the data you wish to store, and not worry about the performance difference as it is probably going to be negligible.

Upvotes: 1

Related Questions