forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
117649: colexecagg: share agg func allocs between different functions if possible r=yuzefovich a=yuzefovich Previously, for every aggregate function we would always create a fresh `aggregateFuncAlloc` struct. That allocator is used to batch-allocate buckets. However, we would never share the alloc between different output columns even if the same aggregate function type overload is used. This commit addresses that inefficiency by enumerating all possible aggregate overloads for optimized aggregate functions and storing them in a single stack-allocated slice for reuse. This slice first stores 11 anyNotNull aggregates, then 6 avg aggregates, then 1 boolAnd aggregate, etc. In other words, each aggregate overload has a fixed spot in the array. This scheme was chosen over two dimensional array to remove any unused slots (we could have a separate slice for each aggregate type, and that slice would be up to 11 - the maximum number of type overloads any aggregate can have right now). The main observation that allows us to easily reuse these allocs is the fact that there is no concurrency when allocating buckets. For hash aggregation we currently use 128 allocation size in these allocators whereas for ordered / window aggregation we use just 1. This commit additionally extends `aggregateFuncAlloc` interface to add a method to increment the alloc size by 1. Namely, we don't change anything in case of the hash aggregation (meaning the same pool of 128 size can now be shared among multiple functions), but for ordered and window aggregations we increment the alloc size every time we reuse the allocator - this will make it so that for ordered / window aggs we batch-allocate all necessary objects at once. Still, by far the main benefit of this change will be observed in case of the hash aggregation with small number of groups (buckets). Addresses: cockroachdb#117546. Epic: None. Release note: None 117751: stress: reduce timeouts for `deadlock` and `race` under RBE r=celiala a=rickystewart `deadlock` timeouts appear to be much higher than they need to: `race` can also be reduced somewhat. Epic: CRDB-8308 Release note: None 117752: workflows: remove experimental EngFlow `master` build r=celiala a=rickystewart This did not improve anything so it can be removed for now. Epic: CRDB-8308 Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Ricky Stewart <[email protected]>
- Loading branch information
Showing
33 changed files
with
764 additions
and
186 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.