Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Andrei Lepikhov <lepihov(at)gmail(dot)com>, Pgsql Performance <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17)
Date: 2025-05-12 15:33:02
Message-ID: 38201.1747063982@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andrei Lepikhov 2025-05-12 17:22:05 Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17)
Previous Message Maxim Boguk 2025-05-12 15:18:43 Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17)