Re: limits of max, min optimization

2022-07-18 Thread Pavel Stehule
po 18. 7. 2022 v 16:29 odesílatel Tom Lane napsal: > Alvaro Herrera writes: > > On 2022-Jul-18, Pavel Stehule wrote: > >> I am trying to fix one slow query, and found that optimization of min, > max > >> functions is possible only when there is no JOIN in the query. > > > See preprocess_minmax_a

Re: limits of max, min optimization

2022-07-18 Thread Tom Lane
Alvaro Herrera writes: > On 2022-Jul-18, Pavel Stehule wrote: >> I am trying to fix one slow query, and found that optimization of min, max >> functions is possible only when there is no JOIN in the query. > See preprocess_minmax_aggregates() in > src/backend/optimizer/plan/planagg.c > Maybe it i

Re: limits of max, min optimization

2022-07-18 Thread Alvaro Herrera
On 2022-Jul-18, Pavel Stehule wrote: > Hi > > I am trying to fix one slow query, and found that optimization of min, max > functions is possible only when there is no JOIN in the query. > > Is it true? See preprocess_minmax_aggregates() in src/backend/optimizer/plan/planagg.c > select max(inse