Re: [HACKERS] Runtime Partition Pruning

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Beena Emerson <memissemerson(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, amul sul <sulamul(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: [HACKERS] Runtime Partition Pruning
Date: 2017-12-21 23:53:33
Message-ID: CAKJS1f8q_d7_Viweeivt1eS4Q8a0WAGFbrgeX38468mVgKseTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 22 December 2017 at 12:45, Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gene Selkov 2017-12-21 23:55:41 Re: genomic locus
Previous Message David Rowley 2017-12-21 23:49:23 Re: [HACKERS] Runtime Partition Pruning