The "v2" groupBy strategy implemented in #2998 showed a good speed boost over the IncrementalIndex based strategy. But even after that patch, the outer query of a nested groupBy is still done using a pair of incremental indexes (one for the inner results and one for the outer results).
Using the code from the "v2" engine for the outer query too should offer better performance and memory management characteristics. This would mean that with "v2", the groupBy query would never need to use an IncrementalIndex for any purpose.
The "v2" groupBy strategy implemented in #2998 showed a good speed boost over the IncrementalIndex based strategy. But even after that patch, the outer query of a nested groupBy is still done using a pair of incremental indexes (one for the inner results and one for the outer results).
Using the code from the "v2" engine for the outer query too should offer better performance and memory management characteristics. This would mean that with "v2", the groupBy query would never need to use an IncrementalIndex for any purpose.