Обсуждение: Data type recommendation

Поиск
Список
Период
Сортировка

Data type recommendation

От
Thomas Lim
Дата:
According to the user guide, it is mentioned that TEXT data type is
recommended over CHAR or VARCHAR.  Does anyone know why?  I thought the
access time for TEXT is slower.  Shouldn't CHAR be used for key fields?
Is there some sort of overheads for CHAR or VARCHAR that TEXT is
recommended?  Hope that someone has an answer to this recommendation.

Thanks,
Thomas Lim.



Re: [GENERAL] Data type recommendation

От
Herouth Maoz
Дата:
At 11:02 +0300 on 04/08/1999, Thomas Lim wrote:


> According to the user guide, it is mentioned that TEXT data type is
> recommended over CHAR or VARCHAR.  Does anyone know why?  I thought the
> access time for TEXT is slower.  Shouldn't CHAR be used for key fields?
> Is there some sort of overheads for CHAR or VARCHAR that TEXT is
> recommended?  Hope that someone has an answer to this recommendation.

Text and Varchar are represented in the same way, but Text is preferred
because it has no maximum limit (except, of course, the notorious tuple
size).

I don't know if this still holds in 6.5, though I think it is, but indeed,
fixed-size fields have a better access time than variable-length fields
(thus CHAR is better than TEXT), provided that they are in the beginning of
the tuple (that is, they don't come after any variable-length column).

However, they are space-wasteful. CHAR types take the same storage space,
with spaces added on the right, regardless of the fact that the actual data
is shorter.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma