Re: Converting MySQL tinyint to PostgreSQL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Converting MySQL tinyint to PostgreSQL
Дата
Msg-id 25840.1121202916@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Converting MySQL tinyint to PostgreSQL  (Joe <svn@freedomcircle.net>)
Ответы Re: Converting MySQL tinyint to PostgreSQL  (Joe <svn@freedomcircle.net>)
Список pgsql-general
Joe <svn@freedomcircle.net> writes:
> I never would've imagined *that* amount of overhead for CHAR(1)!  I
> would've imagined that it would take up one byte (or two with a NULL
> indicator).  After all, we're not talking about VARCHAR(1) [which is
> sort of useless].  Don't the catalogs know the declared length and if
> so, why the length overhead?

Because the length specification is in *characters*, which is not by any
means the same as *bytes*.

We could possibly put enough intelligence into the low-level tuple
manipulation routines to count characters in whatever encoding we happen
to be using, but it's a lot faster and more robust to insist on a count
word for every variable-width field.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Joe
Дата:
Сообщение: Re: Converting MySQL tinyint to PostgreSQL
Следующее
От: Marco Gaiarin
Дата:
Сообщение: 7.2 -> 7.4: horrible performance hit!