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

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: JSONB index not in use, but is TOAST the real cause of slow query?
Дата
Msg-id CAMkU=1yuOCa8R8fw6hE0JbnRY8RWr+aKGre6UvaPBV0k6Mi=fg@mail.gmail.com
обсуждение исходный текст
Ответ на JSONB index not in use, but is TOAST the real cause of slow query?  (Shaheed Haque <shaheedhaque@gmail.com>)
Список pgsql-general
On Sat, May 28, 2022 at 1:54 PM Shaheed Haque <shaheedhaque@gmail.com> wrote:
 

And how can I understand the dreadful amount of
time (of course, this is just on my dev machine, but still...)? Is
there a way to see/tweak what TOAST costs or indeed to confirm if it
is even in use?

Turn on track_io_timing, and then do explain (analyse, buffers).  This won't distinguish TOAST from main table IO, but will at least confirm if a large amount of IO is happening and how long it is taking.  

You can look at pg_statio_user_tables before the after the query to distinguish TOAST, but this won't give you the timing, just the block counts.  And the counts might also get incremented by concurrent users, so on a busy system it is hard to interpret.

Are these queries fast upon repeat execution?  A few meg time less than 1000 it just not that much with modern hardware, you should be able to just cache it in RAM.

Cheers,

Jeff

В списке pgsql-general по дате отправления:

Предыдущее
От: Shaheed Haque
Дата:
Сообщение: Re: Is it possible to index "deep" into a JSONB column?
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: autovacuum on primary blocking queries on replica?