pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Shaheed Haque <shaheedhaque@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
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 12:58:09 -0700
Message-ID: <32fd4aed-f879-9d45-208c-b53e9eb6903c@aklaver.com> (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>

On 5/28/22 12:38, Shaheed Haque wrote:
> Tom,
> 
> Thanks for the considered advice and insights. My takeaway is that
> based on what I've said,you are mostly unsurprised by the results I
> see. In the longer term, the number of rows will increase but I will
> have to ponder options for the immediate future. I'll have a play with
> the knobs you suggested and will report back with anything of note.
> 
> 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?

See:

https://www.postgresql.org/docs/current/storage-toast.html

and from there:

https://www.postgresql.org/docs/current/sql-altertable.html

Search for SET STORAGE.

It might help with(from Tom Lane):

"Unfortunately the planner doesn't account
for detoasting costs when making such estimates, ..."

but probably not much with:

" ...because anything at all that you do with
that big JSONB column is going to be expensive.  (Another thing
that's been on the to-do list for awhile is enabling partial
retrieval of large JSONB values, but AFAIK that hasn't happened
yet either.)

> 
> Thanks, Shaheed
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (9+ messages)  latest in thread

Message-ID: <32fd4aed-f879-9d45-208c-b53e9eb6903c@aklaver.com>
Permalink:  ../32fd4aed-f879-9d45-208c-b53e9eb6903c@aklaver.com/
Also on:    postgresql.org/message-id/32fd4aed-f879-9d45-208c-b53e9eb6903c@aklaver.com

 · 

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 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: adrian.klaver@aklaver.com, shaheedhaque@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: JSONB index not in use, but is TOAST the real cause of slow query?
  In-Reply-To: <32fd4aed-f879-9d45-208c-b53e9eb6903c@aklaver.com>
  References: <CAHAc2jf6Yp2uddfKQyGp=byvOuUzYpsHoPjyKXnUhS5+=Acuww@mail.gmail.com> <3110295.1653763316@sss.pgh.pa.us> <CAHAc2jcGDouJad=f4U6E7KOT1AwHLonjcG7eoUD00p7x2qizEw@mail.gmail.com> <32fd4aed-f879-9d45-208c-b53e9eb6903c@aklaver.com>

* 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