RE: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...
| From: | Robinson, Mike | Date: | Wed, 24 Oct 2001 14:28:58 +0000 |
| Subject: | RE: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13666@lists.php.net to get a copy of this message | ||
In these days and times, conservation of a meg of disk
space is really not a consideration. Not the primary one anyway.
The data should be stored in a format such that the
storage itself and then retrieval can be executed with a
minimum of handling/intervention other than the required
sanity-checking.
I've found that a set of date/time select controls and storage
in a datetime field have been optimal. Insertion requires
no parsing or complex handling (just some gluing of array
elements) and retrieval with mysql's date-related functions
means I don't need to touch the data one bit to display
it in a meaningful way.
For me, having to parse information before insertion,
or after retrieval in order to display it, wastes far
more resources than storing dates in a format other than
an int.
Mike Robinson
IT / Developer - Toronto Star TV
Phone: 416.945.8786
Fax: 416.869.4566
Email: mrobinson@torontostartv.com
> -----Original Message-----
> From: Mike Frazer [mailto:mike@invertedmind.com]
> Sent: Wednesday, October 24, 2001 8:54 AM
> To: php-dev@lists.php.net; php-db@lists.php.net
> Subject: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...
>
>
> Agreed. This is especially useful when you need to conserve
> every byte you
> can; a timestamp of "10/24/2001" or something similar is
> going to take 10
> bytes as a string and an indeterminate number of bytes for an actual
> timestamp because of system variations, whereas an integer
> value of 10242001
> will take you 2-4 bytes depending on the type of int you
> declare. Not a lot
> of space, but assume for a second you have 30 fields in your
> database and 5
> million rows...suddenly those 6-8 bytes have multiplied on
> this one field
> alone. Space and speed are important in DBs :)
>
> Mike Frazer