You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toreducethenumberofnetworkroundtripsrequiredtoretrieveallapplicableresults, youcanincreasethepagesizeusing [x-ms-max-item-count](https://docs.microsoft.com/rest/api/cosmos-db/common-cosmosdb-rest-request-headers) request header to up to 1000. In cases where you need to display only a few results, for example, if your user interface or application API returns only 10 results a time, you can also decrease the page size to 10 to reduce the throughput consumed for reads and queries.
140
+
Toreducethenumberofnetworkroundtripsrequiredtoretrieveallapplicableresults, youcanincreasethepagesizeusing [x-ms-max-item-count](https://docs.microsoft.com/rest/api/cosmos-db/common-cosmosdb-rest-request-headers) request header to up to 1000. In cases where you need to display only a few results, for example, if your user interface or application API returns only 10 results a time, you can also decrease the page size to 10 to reduce the throughput consumed for reads and queries.
>ThemaxItemCountpropertyshouldn't be used just for pagination purpose. It'smainusageittoimprovetheperformanceofqueriesbyreducingthemaximumnumberofitemsreturnedinasinglepage.
144
+
145
+
YoucanalsosetthepagesizeusingtheavailableAzureCosmosDBSDKs. The [MaxItemCount](/dotnet/api/microsoft.azure.documents.client.feedoptions.maxitemcount?view=azure-dotnet) propertyinFeedOptionsallowsyoutosetthemaximumnumberofitemstobereturnedintheenmurationoperation. When `maxItemCount` issetto -1, theSDKautomaticallyfindsthemostoptimalvaluedependingonthedocumentsize. Forexample:
146
+
147
+
```csharp
148
+
IQueryable<dynamic>authorResults=client.CreateDocumentQuery(documentCollection.SelfLink, "SELECT p.Author FROM Pages p WHERE p.Title = 'About Seattle'", newFeedOptions { MaxItemCount=1000 });
149
+
```
150
+
151
+
Whenaqueryisexecuted, theresultingdataissentwithinaTCPpacket. Ifyouspecifytoolowvaluefor `maxItemCount`, thenumberoftripsrequiredtosendthedatawithintheTCPpacketarehigh, whichimpactstheperformance. Soifyouarenotsurewhatvaluetosetfor `maxItemCount` property, it's best to set it to -1 and let the SDK choose the default value.
143
152
144
-
IQueryable<dynamic>authorResults=client.CreateDocumentQuery(documentCollection.SelfLink, "SELECT p.Author FROM Pages p WHERE p.Title = 'About Seattle'", newFeedOptions { MaxItemCount=1000 });
145
153
10. **Increasenumberofthreads/tasks**
146
154
147
155
See [Increasenumberofthreads/tasks](#increase-threads) intheNetworkingsection.
0 commit comments