Odp: [PHP-DB] VARCHAR/CHAR question...
| From: | Jarek Zgoda | Date: | Sat, 09 Dec 2000 08:43:08 +0000 |
| Subject: | Odp: [PHP-DB] VARCHAR/CHAR question... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5137@lists.php.net to get a copy of this message | ||
Od: "Adv. Systems Design" <asd_2000@yahoo.com>
Temat: Re: [PHP-DB] VARCHAR/CHAR question...
> ...it really makes little difference...in terms of
> storage, if you really plan to have so many records
> that this would be of consequence, you are probably
> better off going with a databa$e like oracle...
I know this issue from InterBase.
In case of real databases, the engine has something called "query optimizer"
which takes your query and looks if it can be executed faster, specially if
you use joins, orderings or groupings. The case of CHAR(n) vs VARCHAR(n) is
also considered by optimizer - it tries to determine real field length for
VARCHAR(n), while CHAR(n) has already its real length defined. This does not
mean, that you will see variable field lengths in a result set, but the
optimizer must know it to succesfully allocate enough memory for descriptor
area.
Cheers
Jarek Zgoda