Re: stawidth inconsistency with all NULL columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: stawidth inconsistency with all NULL columns
Дата
Msg-id 4897.1558472065@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: stawidth inconsistency with all NULL columns  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> On 5/21/19 3:55 PM, Tom Lane wrote:
>> Are you suggesting that we should set stawidth to zero even for a
>> fixed-width datatype?  That seems pretty silly.  We know exactly what
>> the value should be, and would be if we'd chanced to find even one
>> non-null entry.

> Well you could argue in similar fashion for variable width values -- if
> we find even one of those, it will be at least 4 bytes. So why set those
> to zero?

Um, really the minimum width is 1 byte, given short headers.  But as
the code notes, zero means we don't know what a sane estimate would
be, which is certainly not the case for fixed-width types.

            regards, tom lane



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: PG 12 draft release notes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PG 12 draft release notes