Re: mysql date field vs unix epoch in an int(10) field.
| From: | Jason Wong | Date: | Sat, 10 May 2003 08:25:23 +0000 |
| Subject: | Re: mysql date field vs unix epoch in an int(10) field. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27635@lists.php.net to get a copy of this message | ||
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 ...
*/