From: Tom Lane <tgl@sss.pgh.pa.us>
To: Maksim Milyutin <milyutinma@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Slow planning time for simple query
Date: Sat, 09 Jun 2018 15:49:09 -0400
Message-ID: <9661.1528573749@sss.pgh.pa.us> (raw)
In-Reply-To: <36adf760-680b-7a4a-e019-64f4eaaf6ff7@gmail.com>
References: <36adf760-680b-7a4a-e019-64f4eaaf6ff7@gmail.com>
Maksim Milyutin <milyutinma@gmail.com> writes:
> On hot standby I faced with the similar problem.
> ...
> is planned 4.940 ms on master and *254.741* ms on standby.
Presumably the problem is that the standby isn't authorized to change
the btree index's "entry is dead" bits, so it's unable to prune index
entries previously detected as dead, and thus the logic that intends
to improve this situation doesn't work on the standby.
(I wonder though why, if you executed the same query on the master,
its setting of the index-entry-is-dead bits didn't propagate to the
standby.)
I wonder if we should extend the "SnapshotNonVacuumable" logic introduced
in commit 3ca930fc3 so that in hot standby, *all* index entries are deemed
non vacuumable. This would essentially get rid of long standby planning
times in this sort of scenario by instead accepting worse (possibly much
worse) planner range estimates. I'm unsure if that's a good tradeoff or
not.
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, milyutinma@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Slow planning time for simple query
In-Reply-To: <9661.1528573749@sss.pgh.pa.us>
References: <36adf760-680b-7a4a-e019-64f4eaaf6ff7@gmail.com> <9661.1528573749@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