Re: [HACKERS] path toward faster partition pruning - Mailing list pgsql-hackers

From David Rowley
Subject Re: [HACKERS] path toward faster partition pruning
Date
Msg-id CAKJS1f8JgARGatcjQ9K4DmMc7M=TjgiW-fCOn6mgv-pkK6tZ=Q@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] path toward faster partition pruning  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [HACKERS] path toward faster partition pruning
List pgsql-hackers
On 22 February 2018 at 22:48, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
>> I'm having to add some NULL handling there for the run-time pruning
>> patch but wondered if it was also required for your patch.
>
> Hmm, not sure why.  Can you explain a bit more?

hmm, yeah, but perhaps we should be discussing on the other thread...

With a prepared statement the Param will be unavailable until
execution, in which case we don't do the const folding.

A simple case is:

create table listp (a int) partition by list (a);
create table listp1 partition of listp for values in(1);
prepare q1 (int) as  select * from listp where a = $1;
explain analyze execute q1(1); -- repeat 5 times.
explain analyze execute q1(null); -- partkey_datum_from_expr() gets a
NULL param via the call from nodeAppend.c


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


pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [HACKERS] path toward faster partition pruning
Next
From: Claudio Freire
Date:
Subject: Re: Hash Joins vs. Bloom Filters / take 2