Sent: Tuesday, April 09, 2002 2:14 PM
Subject: Re: TIMESTAMP(14) or Bigint ??


> David,
>     I could be wrong but since bigint isn't a date or time oriented data
> type I imagine this would be completely useless to you unless you are
> storing unix timestamps.

In fact i'm looking to a way to store date and time in only one field and
with the smallest space.
I can take date and time with my C client client and then create a string
like YYYYMMDDHHMMSS manually ...

> You also have the option of using datetime data
> types. I'm not quite sure what you are asking nor what difference it makes
> how big the field is in bytes. Timestamp and Datetime are pretty much the
> same except the first timestamp field of every row will automatically be
> "timestamped" when you do update's or inserts with a null value in the
> field.
>
> Ric.
>

As we can see here :
http://www.mysql.com/doc/n/o/node_367.html

TIMESTAMP is 4 Bytes and DATETIME is 8 Bytes.
So, 4 Bytes difference per 5 Millions records = a 20 MB bigger  table ...

But i think the feature "timestamp field of every row will automatically be
"timestamped" ... " will anoy me.

In fact the mos efficient way to store date and time will be 2 fields : date
= 3 Bytes, time = 3 Bytes
but when i'm doing sql query like this : select * from Table where field4 =
15 order by date , time;
i can use index for the where but not for the order by, explain say me "file
sort"

So i thought to store date and time in only one field ...


David



---------------------------------------------------------------------
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

Reply via email to