Re: Slow planning time for simple query

Поиск
Список
Период
Сортировка
От Jeremy Finzel
Тема Re: Slow planning time for simple query
Дата
Msg-id CAMa1XUjHWJWx+uOR9Y5JyYSrH2=zq-zDztc8ZOV8QhNd_VBa_w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Slow planning time for simple query  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Slow planning time for simple query
Список pgsql-general


On Wed, Jun 6, 2018 at 12:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jeremy Finzel <finzelj@gmail.com> writes:
> We have an odd scenario on one of our OLTP systems, which behaves the same
> way on a streamer, of a 700-1000ms planning time for a query like this:

> SELECT *
> FROM table1
> WHERE  source_id IN (SELECT id FROM table2 WHERE customer_id = $1);

Hm.  Is this the first query executed in a session?  If so maybe it's
got something to do with populating caches and other session spin-up
overhead.

Another theory is it's some sort of locking issue.  Turning on
log_lock_waits, and setting deadlock_timeout to say 100ms, would help
in investigating that.

                        regards, tom lane

I have run it over and over with no improvement in the planning time, so I don't thing it's first in session-related.  I can only make it faster with a pl function so far.

We have log_lock_waits on and nothing shows, and turning down deadlock_timeout also doesn't do anything.

Thanks,
Jeremy

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Code of Conduct plan
Следующее
От: Jeremy Finzel
Дата:
Сообщение: Re: Slow planning time for simple query