Re: [HACKERS] path toward faster partition pruning

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Beena Emerson <memissemerson(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] path toward faster partition pruning
Date: 2018-02-23 01:41:00
Message-ID: 4c8af3a6-6d05-2fb6-2adb-b20b8731713e@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018/02/22 20:28, David Rowley wrote:
> On 22 February 2018 at 22:48, Amit Langote
> <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)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.

Ah right.

> 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

I wonder if NULLs should somehow be managed at a higher level, resulting
in the same behavior as const-folding in the optimizer produces? In any
case, I suppose that would be something for the run-time pruning patch to
handle.

Thanks,
Amit

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2018-02-23 01:50:48 Re: Translations contributions urgently needed
Previous Message Craig Ringer 2018-02-23 01:31:10 Re: Translations contributions urgently needed