[PERFORM] Query planner gaining the ability to replanning after start of query execution. - Mailing list pgsql-performance

From Oliver Mattos
Subject [PERFORM] Query planner gaining the ability to replanning after start of query execution.
Date
Msg-id CAER07O05V+3Sut=--F0Cagve81Rj7dm4fDdsUoS7NiuS+sU4hw@mail.gmail.com
Whole thread Raw
Responses Re: [PERFORM] Query planner gaining the ability to replanning afterstart of query execution.
List pgsql-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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PERFORM] DB slowness after upgrade from Postgres 9.1 to 9.4
Next
From: Arne Roland
Date:
Subject: Re: [PERFORM] Query planner gaining the ability to replanning afterstart of query execution.