-
Notifications
You must be signed in to change notification settings - Fork 2
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/6299~1
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/6299
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 6 commits
- 36 files changed
- 2 contributors
Commits on Dec 12, 2025
-
add in-memory btree tuple index
This patch implements in-memory B+tree structure. It will be used as index for special type of grouping using index. Size of each node is set using macro. For convenience equals 2^n - 1, so for internal nodes we effectively calculate size of each page and find split node (exactly in the middle), and for leaf nodes we can distribute tuples for each node uniformely (according to the newly inserted tuple). It supports different memory contexts for tracking memory allocations. And just like in TupleHashTable during Lookup it uses 'isnew' pointer to prevent new tuple creation (i.e. when memory limit is reached). Also it has key abbreviation optimization support like in tuplesort. But some code was copied and looks exactly the same way, so it is worth separating such logic into a separate function.
Sergey Soloviev authored and Commitfest Bot committedDec 12, 2025 Configuration menu - View commit details
-
Copy full SHA for ca1f428 - Browse repository at this point
Copy the full SHA ca1f428View commit details -
introduce AGG_INDEX grouping strategy node
AGG_INDEX is a new grouping strategy that builds in-memory index and use it for grouping. The main advantage of this approach is that output is ordered by grouping columns and if there are any ORDER BY specified, then it will use this to build grouping/sorting columns. For index it uses B+tree which was implemented in previous commit. And overall it's implementation is very close to AGG_HASHED: - maintain in-memory grouping structure - track memory consuption - if memory limit reached spill data to disk in batches (using hash of key columns) - hash batches are processed one after another and for each batch fill new in-memory structure For this reason many code logic is generalized to support both index and hash implementations: function generalization using boolean arguments (i.e. 'ishash'), rename spill logic members in AggState with prefix 'spill_' instead of 'hash_', etc. Most differences are in spill logic: to preserve sort order in case of disk spill we must dump all indexes to disk to create sorted runs and perform final external merge. One problem is external merge. It's adapted from tuplesort.c - introduce new operational mode - tuplemerge (with it's own prefix). Internally we just setup state accordingly and process as earlier without any significant code changes. Another problem is what tuples to save into sorted runs. We decided to store tuples after projection (when it's aggregates are finalized), because internal transition info is represented by value/isnull/novalue tripple (in AggStatePerGroupData) which is quiet hard to serialize and handle, but actually, after projection all group by attributes are saved, so we can access them during merge. Also, projection applies filter, so it can discard some tuples.
Sergey Soloviev authored and Commitfest Bot committedDec 12, 2025 Configuration menu - View commit details
-
Copy full SHA for a1aa8d4 - Browse repository at this point
Copy the full SHA a1aa8d4View commit details -
make use of IndexAggregate in planner and explain
This commit adds usage of IndexAggregate in planner and explain (analyze). We calculate cost of IndexAggregate and add AGG_INDEX node to the pathlist. Cost of this node is cost of building B+tree (in memory), disk spill and final external merge. For EXPLAIN there is only little change - show sort information in "Group Key".
Sergey Soloviev authored and Commitfest Bot committedDec 12, 2025 Configuration menu - View commit details
-
Copy full SHA for dce8bbd - Browse repository at this point
Copy the full SHA dce8bbdView commit details -
add support for Partial IndexAggregate
Now IndexAggregate support partial aggregates. The main problem was with partial aggregates which creates SortGroupClause for same expression as in target list, but different sortgroupclause, so make_pathkeys_for_sortclases failed to find required target list entry and throws ERROR. To fix this now we explicitly pass pathkeys to create_agg_path (but only for AGG_INDEX for now), so caller is responsible for searching and building pathkeys list.
Sergey Soloviev authored and Commitfest Bot committedDec 12, 2025 Configuration menu - View commit details
-
Copy full SHA for ad68c0f - Browse repository at this point
Copy the full SHA ad68c0fView commit details -
After adding IndexAggregate node some test output changed and tests broke. This patch updates expected output. Also it adds some IndexAggregate specific tests into aggregates.sql and partition_aggregate.sql.
Sergey Soloviev authored and Commitfest Bot committedDec 12, 2025 Configuration menu - View commit details
-
Copy full SHA for ad84aa0 - Browse repository at this point
Copy the full SHA ad84aa0View commit details -
[CF 6299] v3 - New grouping strategy - Index Aggregate
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/6299 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/345c715f-edb2-4903-9ae1-00d6ca7e92f1@tantorlabs.ru Author(s): Sergey Solovev
Commitfest Bot committedDec 12, 2025 Configuration menu - View commit details
-
Copy full SHA for 396ac62 - Browse repository at this point
Copy the full SHA 396ac62View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff cf/6299~1...cf/6299