Re: Introduce Index Aggregate - new GROUP BY strategy

Поиск
Список
Период
Сортировка
От Sergey Soloviev
Тема Re: Introduce Index Aggregate - new GROUP BY strategy
Дата
Msg-id 71b16ba8-c65a-4ef1-a197-2f7d39650101@tantorlabs.ru
обсуждение исходный текст
Ответ на Re: Introduce Index Aggregate - new GROUP BY strategy  (Sergey Soloviev <sergey.soloviev@tantorlabs.ru>)
Ответы Re: Introduce Index Aggregate - new GROUP BY strategy
Список 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
Вложения

В списке pgsql-hackers по дате отправления: