public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrei Lepikhov <[email protected]>
To: Maxim Boguk <[email protected]>
Cc: [email protected]
Subject: Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17)
Date: Sun, 18 May 2025 18:54:24 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAK-MWwSgP2_br2jHtZSWYEH-T9tDx73LxqkNez-0kmck_wk=xQ@mail.gmail.com>
References: <CAK-MWwS_2UwF7XPy-8XpcVqUjEveDjDQRbXxPyzvJM+ooWeh9A@mail.gmail.com>
	<[email protected]>
	<CAK-MWwRP+OsZhEi5LGZcsWZikMj5+cCmVmK9oKgssFViF13NCQ@mail.gmail.com>
	<[email protected]>
	<CAK-MWwSgP2_br2jHtZSWYEH-T9tDx73LxqkNez-0kmck_wk=xQ@mail.gmail.com>

On 5/12/25 16:04, Maxim Boguk wrote:
> On Mon, May 12, 2025 at 4:48 PM Andrei Lepikhov <[email protected] 
>     If I'm not mistaken, it will work with all PG versions that are
>     currently in support. What do you think?
> 
> 
> Such extension would be very useful (and in general - the solution based 
> on the actual execution data - seems more stable/predictable than the 
> plan cost based selection which is currently used by postgresql).
I've written a sketch of such an extension; see [1]. A trivial strategy 
is implemented to force prepared statements to use a generic plan if the 
planning time exceeds the maximum execution time.
It is just an example - it is written in plpgsql, and you can implement 
alternative strategies independently.
I would be happy if it covered your use case. Any feedback is welcome.

[1] https://github.com/danolivo/pg_mentor/tree/main

-- 
regards, Andrei Lepikhov





view thread (16+ messages)

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]
  Subject: Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17)
  In-Reply-To: <[email protected]>

* 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