public inbox for pgsql-performance@postgresql.org
help / color / mirror / Atom feedFrom: Oliver Mattos <omattos@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Query planner gaining the ability to replanning after start of query execution.
Date: Mon, 13 Nov 2017 16:44:49 +0000
Message-ID: <CAER07O05V+3Sut=--F0Cagve81Rj7dm4fDdsUoS7NiuS+sU4hw@mail.gmail.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
I am interested in giving the query planner the ability to replan (or
re-rank plans) after query execution has begun, based on the
progression of the query so far.
Example use case:
* A LIMIT 1 query is planned using an expensive scan which the
planner expects to return a large number of results, and to terminate
early. The reality is the query actually produces no results, and
the scan must run to completion, potentially taking thousands of times
longer than expected.
* If this plans costs were adjusted mid-execution to reflect the fact
that the scan is producing far fewer rows than expected, then another
query plan might come out ahead, which would complete far faster.
Has this been done before? Are there any pitfalls to beware of?
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: omattos@gmail.com
Subject: Re: Query planner gaining the ability to replanning after start of query execution.
In-Reply-To: <CAER07O05V+3Sut=--F0Cagve81Rj7dm4fDdsUoS7NiuS+sU4hw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox