=?utf-8?Q?Micha=C5=82_K=C5=82eczek?= <mic...@kleczek.org> writes: >> On 30 Sep 2024, at 14:14, Ashutosh Bapat <ashutosh.bapat....@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