On Fri, 2002-06-14 at 16:23, Ray wrote: > > in the manual: > |6.2.6.2 Storage requirements for date and time types > | > |Column type Storage required > |DATE 3 bytes > |DATETIME 8 bytes > |TIMESTAMP 4 bytes > |TIME 3 bytes > |YEAR 1 byte > > so, does datetime do more then date + time? > datetime = 8 bytes, date + time = 6 bytes > > its really a pointless question, but just something that caught my attention > while i was looking for something else.
Hi Ray, I could not resist trying to find an answer for your question. The old DATE column type used to require 4 bytes. It was rewritten to require only 3 bytes. While the new, improved version requires less space, the code is more complex. The TIME type may also have originally required an extra byte, however the source code does not show evidence of this and it is too late to dig a lot of digging in changelogs. :) The DATETIME column does not do more than the DATE or TIME columns. Interestingly, there is a comment in the source that states: Stored as a 8 byte unsigned int. Should sometimes be change to a 6 byte int. :) If you are really curious, take a look at the file sql/field.cc around lines 2800 to 3300 for more information. Cheers! -- "Gosh, Batman. The nobility of the almost-human porpoise." --Robin __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Zak Greant <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Advocate /_/ /_/\_, /___/\___\_\___/ Calgary, Canada <___/ www.mysql.com Feed the Dolphin! Order MySQL support from the MySQL developers at https://order.mysql.com/?ref=mzgr --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php