What, if any, is the performance difference between datetime and timestamp?
-
-
Answer:
Adding to Josh's answer, they have different storage sizes and representations. You can infer that TIMESTAMP is a UNIX time value (seconds since UNIX epoch). But being concerned with performance differences between these types is usually pointless micro-optimisation in the context of a disk based database; any I/O swamps any difference, even if it could be measured otherwise. You should choose the type that best models your data.
Toby Thain at Quora Visit the source
Other answers
DateTime: has a range of '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. TimeStamp: has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC. Therefore, TimeStamp is more efficient to store and transmit because it supports a more limited date range. I do not know of any other differences. Further reading can be found here: http://dev.mysql.com/doc/refman/5.0/en/datetime.html
Josh Thornton
Related Q & A:
- What is the performance of INNER JOIN vs WHERE?Best solution by Stack Overflow
- What kind of performance chip should I use for a mercury cougar?Best solution by Yahoo! Answers
- What are performance metrics and why are they important?Best solution by Quora
- What is a hybrid? whats the difference between a hybrid?Best solution by Yahoo! Answers
- What is the best diesel performance chip?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.