Re: PostgreSQL Limits and lack of documentation about them.

Поиск
Список
Период
Сортировка
От John Naylor
Тема Re: PostgreSQL Limits and lack of documentation about them.
Дата
Msg-id CAJVSVGVOme8JgZ17mFrhZuJX=mfgr4AxzpeatoP87uappAmMLA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PostgreSQL Limits and lack of documentation about them.  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers
On 11/1/18, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
> So (with 8k blocks) the limit on the number of non-null external-toasted
> columns is about 450, while you can have the full 1600 columns if they
> are integers or smaller, or just over 1015 bigints. But you can have
> 1600 text columns if they average 4 bytes or less (excluding length
> byte).
>
> If you push too close to the limit, it may even be possible to overflow
> the tuple size by setting fields to null, since the null bitmap is only
> present if at least one field is null. So you can have 1010 non-null
> bigints, but if you try and do 1009 non-null bigints and one null, it
> won't fit (and nor will 999 non-nulls and 11 nulls, if I calculated
> right).

Thanks for that, Andrew, that was insightful. I drilled down to get
the exact values:

Non-nullable columns:
text (4 bytes each or less): 1600
toasted text: 452
int: 1600
bigint: 1017

Nullable columns with one null value:
text (4 bytes each or less): 1600
toasted text: 449
int: 1600
bigint: 1002


-John Naylor


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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: ON COMMIT actions and inheritance
Следующее
От: John Naylor
Дата:
Сообщение: Re: PostgreSQL Limits and lack of documentation about them.