Re: mysql date field vs unix epoch in an int(10) field.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 10 May 2003 12:06, Rolf Brusletto wrote:

> I'm curious which would be faster... I have a need to save a date in mysql.
>
> Option #1: Use a MySQL Date field "2003-05-09"
>
> Option #2: Use a MySQL int(10) field with a unix epoch( time(); )
>
>
> My question is, if I do a query, between two dates, which will be faster?

I would assume that #2 would be quicker as it is only retrieving and comparing 
integers. But if your date field is indexed there might not be much 
difference. However all this is speculation, the best thing to do is make up 
a huge table of random data then do some benchmarking.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
------------------------------------------
/*
Well, I'm INVISIBLE AGAIN ... I might as well pay a visit to the LADIES 
ROOM ...
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux