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 345c715f-edb2-4903-9ae1-00d6ca7e92f1@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 finally added support for Partial IndexAggregate. There was a problem with
sortgroupref and target list entries mismatch due to partial aggregates in it.
To solve this I had to add new argument to 'create_agg_path' - 'pathkeys' which is
a List of PathKey.

Previously this information was calculated in the function just like AGG_SORTED
do this. But when we calculating pathkeys we must consider whether it is a child
rel to properly build pathkeys and if so use it's parent. The latter information is
not known inside 'create_agg_path', thus instead of passing 'parent' we explicitly
pass already built 'pathkeys'. I did not change AGG_SORTED logic, so this  is used
only by AGG_INDEX.

This logic is placed in another patch file just to make review of this change easier.

Also, cost calculation logic is adjusted a bit - it takes into account top-down index
traversal and final external merge cost is added only if spill expected.

---
Sergey Soloviev
TantorLabs: https://tantorlabs.com

Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments
Next
From: Robert Haas
Date:
Subject: Re: pg_plan_advice