File tree Expand file tree Collapse file tree 2 files changed +70
-118
lines changed
src/Query/Core/ExecutionContext
tests/Microsoft.Azure.Cosmos.EmulatorTests Expand file tree Collapse file tree 2 files changed +70
-118
lines changed Original file line number Diff line number Diff line change @@ -146,18 +146,17 @@ public static async Task<CosmosQueryExecutionContext> CreateAsync(
146146
147147 QueryInfo queryInfo = initParams . PartitionedQueryExecutionInfo . QueryInfo ;
148148
149- int actualPageSize = initParams . InitialPageSize ;
150149 int initialPageSize = initParams . InitialPageSize ;
151150 CosmosCrossPartitionQueryExecutionContext . CrossPartitionInitParams parameters = initParams ;
152151 if ( queryInfo . HasGroupBy )
153152 {
154- initialPageSize = int . MaxValue ;
153+ // The query will block until all groupings are gathered so we might as well speed up the process.
155154 initParams = new CosmosCrossPartitionQueryExecutionContext . CrossPartitionInitParams (
156155 sqlQuerySpec : initParams . SqlQuerySpec ,
157156 collectionRid : initParams . CollectionRid ,
158157 partitionedQueryExecutionInfo : initParams . PartitionedQueryExecutionInfo ,
159158 partitionKeyRanges : initParams . PartitionKeyRanges ,
160- initialPageSize : initialPageSize ,
159+ initialPageSize : int . MaxValue ,
161160 maxConcurrency : initParams . MaxConcurrency ,
162161 maxItemCount : int . MaxValue ,
163162 maxBufferedItemCount : initParams . MaxBufferedItemCount ) ;
You can’t perform that action at this time.
0 commit comments