Re: SET or STRICT modifiers on function affect planner row estimates - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SET or STRICT modifiers on function affect planner row estimates
Date
Msg-id 1496155.1727724266@sss.pgh.pa.us
Whole thread Raw
In response to Re: SET or STRICT modifiers on function affect planner row estimates  (Michał Kłeczek <michal@kleczek.org>)
Responses Re: SET or STRICT modifiers on function affect planner row estimates
List pgsql-hackers
=?utf-8?Q?Micha=C5=82_K=C5=82eczek?= <michal@kleczek.org> writes:
>> On 30 Sep 2024, at 14:14, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:
>> It is difficult to understand the exact problem from your description.
>> Can you please provide EXPLAIN outputs showing the expected plan and
>> the unexpected plan; plans on the node where the query is run and
>> where the partitions are located.

> The table structure is as follows:

> CREATE TABLE tbl (…) PARTITION BY RANGE year(col02_date)

You're still expecting people to magically intuit what all those
"..."s are.  I could spend many minutes trying to reconstruct
a runnable example from these fragments, and if it didn't behave
as you say, it'd be wasted effort because I didn't guess right
about some un-mentioned detail.  Please provide a *self-contained*
example if you want someone to poke into this in any detail.
You have not mentioned your PG version, either.

My first guess would be that adding STRICT or adding a SET clause
prevents function inlining, because it does.  However, your Plan 2
doesn't seem to involve a FunctionScan node, so either these plans
aren't really what you say or there's something else going on.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_basebackup and error messages dependent on the order of the arguments
Next
From: Noah Misch
Date:
Subject: Re: AIO v2.0