Re: POC: GROUP BY optimization - Mailing list pgsql-hackers

From Andrei Lepikhov
Subject Re: POC: GROUP BY optimization
Date
Msg-id 282f19f0-cbae-4233-9344-07307c044696@postgrespro.ru
Whole thread Raw
In response to Re: POC: GROUP BY optimization  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
On 20/5/2024 15:54, jian he wrote:
> As mentioned previously,
> both A and B can use Incremental Sort, set_cheapest will choose the A
> instead of B,
> because A step generated path **first** satisfies increment sort.
Yeah, I agree with your analysis.
Looking into the cost_incremental_sort, I see that we have ten 
group_tuples. This value doesn't depend on how many presorted keys (1 or 
2) we use. This is caused by default estimation.
Given the current circumstances, it seems unlikely that we can make any 
significant changes without introducing a new sort cost model that 
accounts for the number of sorted columns.

-- 
regards,
Andrei Lepikhov
Postgres Professional




pgsql-hackers by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Re: CREATE DATABASE with filesystem cloning
Next
From: Nazir Bilal Yavuz
Date:
Subject: Re: zlib detection in Meson on Windows broken?