Re: [HACKERS] Runtime Partition Pruning - Mailing list pgsql-hackers

From David Rowley
Subject Re: [HACKERS] Runtime Partition Pruning
Date
Msg-id CAKJS1f8q_d7_Viweeivt1eS4Q8a0WAGFbrgeX38468mVgKseTA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Runtime Partition Pruning  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] Runtime Partition Pruning  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 22 December 2017 at 12:45, Robert Haas <robertmhaas@gmail.com> wrote:
> PREPARE q3 (int, int) AS SELECT * FROM unpartitioned_table WHERE
> partkey BETWEEN $1 AND $2;
>
> ...that has to decide whether to use an index.  And to do that it has
> to estimate what fraction of the table will match the BETWEEN clause.
> That may be an uninformed guess, but it guesses something.  We
> probably want to do something here that makes the guess for a
> partitioned_table similar to the guess for an unpartitioned_table.

Are you considering some sort of clauselist_selectivity() estimate on
the given parameters and comparing that to the same selectivities that
were determined for the previous custom plans?

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: [HACKERS] Runtime Partition Pruning
Next
From: Gene Selkov
Date:
Subject: Re: genomic locus