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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/12/25 16:04, Maxim Boguk wrote:
On Mon, May 12, 2025 at 4:48 PM Andrei Lepikhov <lepihov@xxxxxxxxx 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





[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux