Re: Introduce Index Aggregate - new GROUP BY strategy - Mailing list pgsql-hackers

From Sergey Soloviev
Subject Re: Introduce Index Aggregate - new GROUP BY strategy
Date
Msg-id 71b16ba8-c65a-4ef1-a197-2f7d39650101@tantorlabs.ru
Whole thread Raw
In response to Re: Introduce Index Aggregate - new GROUP BY strategy  (Sergey Soloviev <sergey.soloviev@tantorlabs.ru>)
List pgsql-hackers
Hi!

I have looked again at planner's code and found mistake in cost calculation:

1. There was an extra `LOG2(numGroups)` multipler that accounts height of
     btree index, but actually it is extra multiplier. Now cost is calculated as
     much like sort: input_tuples * (2.0 * cpu_operator_cost * numGroupCols).
2. IndexAgg requires spilling index on disk to save sort order, but code that
     calculates this cost used this value without HAVING quals adjustment.

After fixing these parts, more plans started to use Index Aggregate node.
New patches have this fixed.

Also, patches contains several minor fixes of compiler warnings to which I
did not pay attention during development, but CI pipeline complained about.

---
Sergey Soloviev

TantorLabs: https://tantorlabs.com
Attachment

pgsql-hackers by date:

Previous
From: Dagfinn Ilmari Mannsåker
Date:
Subject: Re: Solaris versus our NLS files
Next
From: Srirama Kucherlapati
Date:
Subject: RE: AIX support