Re: why partition pruning doesn't work? - Mailing list pgsql-hackers

From Dmitry Dolgov
Subject Re: why partition pruning doesn't work?
Date
Msg-id CA+q6zcVX9Gp0o06AXrozc0k4zkfera_wQiSyTkKXzgCsEqM6Yg@mail.gmail.com
Whole thread Raw
In response to Re: why partition pruning doesn't work?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: why partition pruning doesn't work?
List pgsql-hackers
> On 3 June 2018 at 19:11, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Dmitry Dolgov <9erthalion6@gmail.com> writes:
>> Just to clarify for myself, for evaluating any stable function here would it be
>> enough to handle all function-like expressions (FuncExpr / OpExpr /
>> DistinctExpr / NullIfExpr) and check a corresponding function for provolatile,
>> like in the attached patch?
>
> I think the entire approach is wrong here.  Rather than concerning
> yourself with Params, or any other specific expression type, you
> should be using !contain_volatile_functions() to decide whether
> an expression is run-time-constant.  If it is, use the regular
> expression evaluation machinery to extract the value.

Yes, it makes sense. Then, to my understanding, the attached code is close to
what was described above (although I'm not sure about the Const part).

Attachment

pgsql-hackers by date:

Previous
From: Jesper Pedersen
Date:
Subject: Re: New committers announced at PGCon 2018
Next
From: Ashutosh Bapat
Date:
Subject: Re: Performance regression with PostgreSQL 11 and partitioning