Since he and he are the same team, so I am very familiar with his "neat" approach, for his many points of view I also very much agree; but there is a very incomprehensible place is the design of the database will always avoid the use of date/time type. His approach is to set the time-dependent field to an INT (10) type, and then store it in a UNIX timestamp. And I personally do not agree with this approach:
First, there is the difference between type operations, and the "Time calculation" of Wildgoose is essentially an operation between the implants (and this is a very large, 10 length). What's more, the time stamp is set to VARCHAR (10), and the efficiency problems raised are self-evident.
As for the efficiency of time and shape calculations and even the calculation of strings, this article is a great illustration of the problem.
Secondly, it is a logical aspect of operational problems. This is the advantage of using the time type, especially on projects that require high precision. For example, "the first one weeks of data" and "access to data from the database every Monday since the date", such operations such as the use of Wildgoose Brother's approach to the complexity imaginable.
Finally, it is intuitive and not intuitive to understand that our brain is not directly to this large string of timestamps into date format. The direct use time type is obviously much more intuitive than the time format itself.
And my current team is still using a similar approach. I have been arguing about similar technical details for a long while, but it is a pity that the team is unable to accept my opinion because of the position and the power of decision.
MySQL is positioned as a simple and fast DBM that can be quickly mastered, but on the other hand it is easy to create a situation that will not go further. For this, we should pay attention to each of the database design details, a product constantly add new features to the end of the application-oriented.
Finally, a handbook with MySQL official time and date functions is attached.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service