From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeremy Finzel <finzelj@gmail.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Slow planning time for simple query
Date: Wed, 06 Jun 2018 13:12:13 -0400
Message-ID: <13756.1528305133@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMa1XUhVCj1ZRB6XqC81MZrnb3biJfq4eR3tY5Bt1nP-YhrUBg@mail.gmail.com>
References: <CAMa1XUhVCj1ZRB6XqC81MZrnb3biJfq4eR3tY5Bt1nP-YhrUBg@mail.gmail.com>
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
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, finzelj@gmail.com
Subject: Re: Slow planning time for simple query
In-Reply-To: <13756.1528305133@sss.pgh.pa.us>
References: <CAMa1XUhVCj1ZRB6XqC81MZrnb3biJfq4eR3tY5Bt1nP-YhrUBg@mail.gmail.com> <13756.1528305133@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