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+q6zcVL=7as7ud5ZNgndH_ytUn-h1=q_v8Cqpfea4-LULweMw@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 1 June 2018 at 17:53, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> writes:
>> I think the patch is right if we were to handle only SQLValueFunction,
>> but the bigger picture here is that we aren't evaluating stable
>> functions before run-time partition pruning happens.
>
> I agree though that it seems strange to special-case SQLValueFunction
> rather than any-stable-expression.  As long as the evaluation happens
> at executor start (i.e. with the query's run-time snapshot) it should
> be reasonable to simplify any stable expression.

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?

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_config.h.win32 missing a set of flags from pg_config.h.inadded in v11 development
Next
From: Pavel Stehule
Date:
Subject: Re: csv format for psql