Re: Design strategy for table with many attributes

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Design strategy for table with many attributes
Дата
Msg-id CAApHDvp6FJW0MnchEfis=2ANUTNu4CHVQOcs95=NwTg4SQrxtQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Design strategy for table with many attributes  (Lok P <loknath.73@gmail.com>)
Ответы Re: Design strategy for table with many attributes
Список pgsql-general
On Fri, 5 Jul 2024 at 19:53, Lok P <loknath.73@gmail.com> wrote:
> As David suggested it breaks if a row exceeds the 8k limit I. E a single page size , will that still holds true if we
havea column with JSON in it?
 

You wouldn't be at risk of the same tuple length problem if you
reduced the column count and stored the additional details in JSON.
Each varlena column is either stored in the tuple inline, or toasted
and stored out of line. Out of line values need an 18-byte pointer to
the toasted data. That pointer contributes to the tuple length.

This isn't me advocating for JSON. I'm just explaining the
limitations. I think I'd only advocate for JSON if the properties you
need to store vary wildly between each tuple.  There's a large
overhead to storing JSON labels, which you'd pay the price of for each
tuple. That sounds like it would scale terribly with the data volumes
you've suggested you'll be processing.

David



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

Предыдущее
От: Lok P
Дата:
Сообщение: Re: Design strategy for table with many attributes
Следующее
От: Lok P
Дата:
Сообщение: Re: Design strategy for table with many attributes