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)
Список
Дерево обсуждения
Introduce Index Aggregate - new GROUP BY strategy Sergey Soloviev <sergey.soloviev@tantorlabs.ru>
Re: Introduce Index Aggregate - new GROUP BY strategy David Rowley <dgrowleyml@gmail.com>
Re: Introduce Index Aggregate - new GROUP BY strategy Sergey Soloviev <sergey.soloviev@tantorlabs.ru>
Re: Introduce Index Aggregate - new GROUP BY strategy Сергей Соловьев <sergey.soloviev@tantorlabs.ru>
Re: Introduce Index Aggregate - new GROUP BY strategy Sergey Soloviev <sergey.soloviev@tantorlabs.ru>
Re: Introduce Index Aggregate - new GROUP BY strategy Sergey Soloviev <sergey.soloviev@tantorlabs.ru>
Re: Introduce Index Aggregate - new GROUP BY strategy Sergey Soloviev <sergey.soloviev@tantorlabs.ru>
Re: Introduce Index Aggregate - new GROUP BY strategy Andrei Lepikhov <lepihov@gmail.com>
Re: Introduce Index Aggregate - new GROUP BY strategy Sergey Soloviev <sergey.soloviev@tantorlabs.ru>
Re: Introduce Index Aggregate - new GROUP BY strategy Sergey Soloviev <sergey.soloviev@tantorlabs.ru>
Re: Introduce Index Aggregate - new GROUP BY strategy Andrei Lepikhov <lepihov@gmail.com>
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 по дате отправления