public inbox for [email protected]
help / color / mirror / Atom feedFrom: David Rowley <[email protected]>
To: Lok P <[email protected]>
Cc: Guyren Howe <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Design strategy for table with many attributes
Date: Fri, 5 Jul 2024 20:13:54 +1200
Message-ID: <CAApHDvp6FJW0MnchEfis=2ANUTNu4CHVQOcs95=NwTg4SQrxtQ@mail.gmail.com> (raw)
In-Reply-To: <CAKna9VYXKu-1KpV_1X3Jz0iNZ+Uf4WGwYRm62tCQvyp4-L0WCw@mail.gmail.com>
References: <CAKna9VbQ=o2Yhjo1EitaxzYpWAXe9vw6QtamzCsNNp2-rQOFSA@mail.gmail.com>
<CAKFQuwYpai5snt5mEgyXK4m6nR5T6sP-YTYH-GQ0Hs2rXS7uLA@mail.gmail.com>
<CAKna9VZdihb=n9mNGaCZLKYbWAoS0+knfi_PAfLC5w=Mj5Egig@mail.gmail.com>
<[email protected]>
<CAKna9VaNKPR9XruS-yz0qLLgAyik6L-_kGX=C8B682wRSmnn=A@mail.gmail.com>
<[email protected]>
<CAKna9VYXKu-1KpV_1X3Jz0iNZ+Uf4WGwYRm62tCQvyp4-L0WCw@mail.gmail.com>
On Fri, 5 Jul 2024 at 19:53, Lok P <[email protected]> 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 have a 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
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Design strategy for table with many attributes
In-Reply-To: <CAApHDvp6FJW0MnchEfis=2ANUTNu4CHVQOcs95=NwTg4SQrxtQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox