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]

 



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.

The best thing for performance is reducing the number of times you hit
the disc. If you can cache (more of) a table by using varchars instead
of chars for some columns, then varchars have an advantage.

Knowing what your data requires leads to better results than picking in
advance whether to use char or varchar (or text). Measuring is even
better.

Oh, and for a column with a limited range of values, enum beats 'em all!
-- 
Ross McKay, Toronto, NSW Australia
"You can't control what you can't measure" - Tom DeMarco

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