Re: Understanding JSONB and TOAST tables

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Understanding JSONB and TOAST tables
Date: 2020-06-09 22:59:19
Message-ID: f6189da9-09f5-90fe-9d0e-7bdcb7589bbe@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 2020-06-09 21:48, Wells Oliver wrote:
> Is there documentation that lays out how JSONB columns are stored? I
> have a Rather Large Table with 37m+ rows with large JSONB objects, its
> size is about 300mb, but there's an associated TOAST table with a 28GB size.
>
> Curious how/why PSQL would store JSONB stuff this way.

TOAST is documented here:
https://www.postgresql.org/docs/current/storage-toast.html. JSONB is
handled like any other (variable-size) data type. You can use the
per-column storage settings mentioned on that page to perhaps achieve
different storage outcomes.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message CRISTINA ASENJO CUELLAR 2020-06-10 14:51:59 replica repmgr
Previous Message Wells Oliver 2020-06-09 19:48:35 Understanding JSONB and TOAST tables