Re: BUG #17650: For the sixth time, the clipping function in the 120 partition table planning stage fails - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17650: For the sixth time, the clipping function in the 120 partition table planning stage fails
Date
Msg-id 2601909.1666101938@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17650: For the sixth time, the clipping function in the 120 partition table planning stage fails  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17650: For the sixth time, the clipping function in the 120 partition table planning stage fails
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> The clipping function of partition table cannot be carried out normally in
> the planning stage.

This looks like normal behavior to me: the sixth iteration is where
the plan cache will try to see if a generic plan would be smarter
to use than a custom one.  Unsurprisingly, for a table partitioned
as heavily as this one, it takes a little while even to construct
a generic plan.  Then it'll decide "nope, we'll stick to custom
planning" and the subsequent executions take the same amount of
time as before.

You could override that with "set plan_cache_mode = force_custom_plan".
But TBH my advice is to use fewer partitions.  There are always going
to be edge cases where the system has to consider all the partitions.
If you're allergic to spending even half a dozen msec in the planner,
you need to set up your tables in a way that doesn't require so much
time when that happens.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: BUG #17650: For the sixth time, the clipping function in the 120 partition table planning stage fails
Next
From: Mike Fröhner
Date:
Subject: Aw: Re:  BUG #17647: 12.12 package has difference on ubuntu 18.04