Re: Because you guys/gals/girls/women/insert pc term here are a smart lot

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

 



On Wed, 2009-01-07 at 13:26 +0000, Richard Heyes wrote:
> >>So where's the advantage of VARCHAR ?
> >
> > Less space on disc = less data retrieved from disc = faster data
> > retrieval - sometimes. If you have small columns, a small number of
> > rows, or both, then char columns may be faster. If you have large
> > columns of varying actual length, lots of rows, or both, then varchar
> > columns may be faster.
> 
> I still think a CHAR field would be faster than a VARCHAR because of
> the fixed row length (assuming every thing else is fixed). Perhaps
> someone from the MySQL list could clarify...?

I would say it depends. For a single row request it certainly should be
since the entire row can be found by pre-computing the offset. However,
multiple rows would mean a larger spread accross the hard drive due to
data padding and this could incurr more slow seeks (remember just
because the data is contiguous doesn't mean it's stored that way
physically).

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux