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?
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?
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.
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 --