pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: dafoer_x@163.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17650: For the sixth time, the clipping function in the 120 partition table planning stage fails
Date: Tue, 18 Oct 2022 10:05:38 -0400
Message-ID: <2601909.1666101938@sss.pgh.pa.us> (raw)
In-Reply-To: <17650-4523221bc4eb0c33@postgresql.org>
References: <17650-4523221bc4eb0c33@postgresql.org>

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





view thread (4+ messages)  latest in thread

Message-ID: <2601909.1666101938@sss.pgh.pa.us>
Permalink:  ../2601909.1666101938@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2601909.1666101938@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dafoer_x@163.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17650: For the sixth time, the clipping function in the 120 partition table planning stage fails
  In-Reply-To: <2601909.1666101938@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox