https://questdb.io logo
Title
j

jl

02/27/2023, 9:58 AM
Hi QuestDB Contributors, I have a question about the physical aggregation operator. I would like to know if we have implemented hash aggregation and streaming aggregation (sorted aggregation) as the physical aggregation operators. Thanks!
a

Andrey Pechkurov

02/27/2023, 10:19 AM
Hi, We have both hash and sorted aggregate algorithms in the query execution engine. Say, most group by record cursor factories use hash aggregation while many sample by ones use the sorted algorithm.
j

jl

02/27/2023, 11:00 AM
Hi, thanks! I would like to know if we have implemented rules or costs to select one of them when building a physical plan. Or could you tell me where that is implemented? I am not so familiar with our codebase.
a

Andrey Pechkurov

02/27/2023, 11:39 AM
Most rules are implicitly defined in
SqlCodeGenerator
. As for the cost-based decision making, we don't have it yet. We have some estimates based on symbol tables, but that's for symbol columns only and the estimates are not precise.
j

jl

02/27/2023, 1:04 PM
Thanks!