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 >