Re: JSONB index not in use, but is TOAST the real cause of slow query?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shaheed Haque <shaheedhaque(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: JSONB index not in use, but is TOAST the real cause of slow query?
Date: 2022-05-28 19:59:12
Message-ID: 3127818.1653767952@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Shaheed Haque <shaheedhaque(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Munro 2022-05-28 20:33:46 Re: Improve configurability for IO related behavoir
Previous Message Adrian Klaver 2022-05-28 19:58:09 Re: JSONB index not in use, but is TOAST the real cause of slow query?