From: Tom Lane <tgl@sss.pgh.pa.us>
To: Shaheed Haque <shaheedhaque@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: JSONB index not in use, but is TOAST the real cause of slow query?
Date: Sat, 28 May 2022 15:59:12 -0400
Message-ID: <3127818.1653767952@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHAc2jcGDouJad=f4U6E7KOT1AwHLonjcG7eoUD00p7x2qizEw@mail.gmail.com>
References: <CAHAc2jf6Yp2uddfKQyGp=byvOuUzYpsHoPjyKXnUhS5+=Acuww@mail.gmail.com>
<3110295.1653763316@sss.pgh.pa.us>
<CAHAc2jcGDouJad=f4U6E7KOT1AwHLonjcG7eoUD00p7x2qizEw@mail.gmail.com>
Shaheed Haque <shaheedhaque@gmail.com> writes:
> One last thought about TOAST. If the cost of the -> retrieving the
> data cannot be obviated, is there any way to tweak how that works?
The only thing that's readily tweakable is to disable data compression
for the out-of-line values (see ALTER TABLE ... SET STORAGE, and note
that you have to rebuild the table for already-stored values to be
changed). It seems unlikely that that will help you much though,
since doing that would save CPU at the cost of more disk I/O, and
it seems that the I/O side is your bottleneck already. It *would*
help if jsonb had logic for partial fetches, because that'd require
uncompressed storage to work. But AFAICS that's not there yet.
I distinctly recall that that was planned for when we were designing
jsonb's on-disk layout, but I see no code actually doing anything
of that sort ... the -> operator certainly doesn't.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, shaheedhaque@gmail.com
Subject: Re: JSONB index not in use, but is TOAST the real cause of slow query?
In-Reply-To: <3127818.1653767952@sss.pgh.pa.us>
References: <CAHAc2jf6Yp2uddfKQyGp=byvOuUzYpsHoPjyKXnUhS5+=Acuww@mail.gmail.com> <3110295.1653763316@sss.pgh.pa.us> <CAHAc2jcGDouJad=f4U6E7KOT1AwHLonjcG7eoUD00p7x2qizEw@mail.gmail.com> <3127818.1653767952@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox