Re: Planner makes sub-optimal execution plan

2025-09-02 Thread Alena Rybakina
Hi! Thank you for sharing this interesting case! On 01.09.2025 12:07, Алексей Борщёв wrote: EXPLAIN (ANALYZE, VERBOSE, BUFFERS, SUMMARY, SETTINGS, TIMING) SELECT MIN(docum.dt) AS "dt__min", MAX(docum.dt_real) AS "dt_real__max" FROM docum WHERE docum.dt_real >= '2025-08-14T09:44:09.0335

Re: Planner makes sub-optimal execution plan

2025-09-01 Thread David Rowley
On Tue, 2 Sept 2025 at 00:41, Alena Rybakina wrote: > After disabling MIN/MAX optimization in the grouping_planner function: > /* > * Preprocess MIN/MAX aggregates, if any. Note: be careful about > * adding logic between here and the query_planner() call. > Anything >

Planner makes sub-optimal execution plan

2025-09-01 Thread Алексей Борщёв
Hi, all! The execution plan was broken during upgrade PG13 to PG14 We've managed to emulate table and reproduce on PG17: # cat /etc/*release PRETTY_NAME="Debian GNU/Linux trixie/sid" select version(); PostgreSQL 17.4 (Debian 17.4-1.pgdg110+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.