Re: Two aesthetic bugs in the 1-byte packed varlena code

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Two aesthetic bugs in the 1-byte packed varlena code
Дата
Msg-id 23376.1181675557@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Two aesthetic bugs in the 1-byte packed varlena code  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-patches
Gregory Stark <stark@enterprisedb.com> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>> After looking closer, I think there are worse problems here: the code is
>> still using VARSIZE/VARDATA etc, which it should not be because the
>> field could easily be in 1-byte-header form.

> Well that's ok because VARATT_IS_EXTENDED returns true for 1-byte forms so
> it'll detoast them first.

Ah, right.

> We could avoid the detoasting but given that it's
> expecting the chunks to be compressed anyways the memcpys of the smallest
> chunks probably don't matter much either way. I'm assuming it's like toast in
> that only the last chunk will be smaller than LOBLKSIZE anyways, right?

Well, it's like toast except that there can be unwritten "holes" in a LO.
Still, in normal cases you'd expect only the last partial page to be
potentially short enough for 1-B format, and even then only about 1/16th
of the time.  OK, not worth changing then.

> There should never even be a null bitmap right? Maybe we should just
> elog(ERROR) if we find HeapTupleHasNulls(tuple) to be true at all.

That sounds like a good and cheap test.  Will make it so.

            regards, tom lane

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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Two aesthetic bugs in the 1-byte packed varlena code
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [HACKERS] COPYable logs status