public inbox for [email protected]  
help / color / mirror / Atom feed
From: Maxim Boguk <[email protected]>
To: Tom Lane <[email protected]>
Cc: David Rowley <[email protected]>
Cc: Andrei Lepikhov <[email protected]>
Cc: Pgsql Performance <[email protected]>
Subject: Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17)
Date: Mon, 12 May 2025 20:55:07 +0300
Message-ID: <CAK-MWwQWMK=d_Uzt63hstuYArAuB6Grv9sjYHMah1JXhgkxG3A@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAK-MWwS_2UwF7XPy-8XpcVqUjEveDjDQRbXxPyzvJM+ooWeh9A@mail.gmail.com>
	<[email protected]>
	<CAApHDvrduvaF6nN9ZQSfOdE0Na9SwPOkwYKn=Rb2a=Q9B72MAQ@mail.gmail.com>
	<CAK-MWwTL=_NjJc9v241VQdavOC4deWgPjoqDxLbvm=wUFKq=ug@mail.gmail.com>
	<[email protected]>

On Mon, May 12, 2025 at 6:33 PM Tom Lane <[email protected]> wrote:

> Maxim Boguk <[email protected]> writes:
> > And the problem is that the cost of a custom plan ignores the cost of
> > planning itself (which is like 2x orders of magnitude worse than the cost
> > of real time partition pruning of a generic plan).
>
> False.  The estimate is evidently pretty wrong, but it's not that
> there is no consideration at all.  See around line 1370 in
> src/backend/utils/cache/plancache.c.
>
>                         regards, tom lane
>

Thank you.
Reading the code - probably the lowest hanging fruit is to make
'The current multiplier of 1000 * cpu_operator_cost' configurable in the
future versions.

PS: it's always nice to see when my ad-hoc idea (about N*nrelations as cost
planner estimate) is already implemented.


-- 
Maxim Boguk
Senior Postgresql DBA

Phone UA: +380 99 143 0000
Phone AU: +61  45 218 5678


view thread (16+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17)
  In-Reply-To: <CAK-MWwQWMK=d_Uzt63hstuYArAuB6Grv9sjYHMah1JXhgkxG3A@mail.gmail.com>

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

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