{"title":"OData/API web service client performance","url":"https://jonas-paprotka.de/docs/dev-itpro/webservices/odata-client-performance/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/odata-client-performance, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/odata-client-performance","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Learn about how to develop efficient and fast OData/API web service clients for Business Central.","date":"2023-07-03","meta":{"topic":"article"},"outline":[{"level":1,"title":"OData/API web service client performance","slug":"odataapi-web-service-client-performance","at":0,"chars":6141},{"level":2,"title":"Using data access intent read-only","slug":"using-data-access-intent-read-only","at":608,"chars":885},{"level":2,"title":"Using OData transaction `$batch`","slug":"using-odata-transaction-batch","at":1493,"chars":237},{"level":2,"title":"Limiting the set (`$filter` or `$top`) if you're using an expensive `$expand` statement","slug":"limiting-the-set-filter-or-top-if-youre-using-an-expensive-expand-statement","at":1730,"chars":320},{"level":2,"title":"Specifying columns in the `$select` clause","slug":"specifying-columns-in-the-select-clause","at":2050,"chars":503},{"level":2,"title":"Specifying columns in the `$select` expand option inside an `$expand` clause","slug":"specifying-columns-in-the-select-expand-option-inside-an-expand-clause","at":2553,"chars":323},{"level":2,"title":"Using a filter on LastModifiedOn when you query for historical data","slug":"using-a-filter-on-lastmodifiedon-when-you-query-for-historical-data","at":2876,"chars":399},{"level":2,"title":"Using `$top` query option to limit the number of records","slug":"using-top-query-option-to-limit-the-number-of-records","at":3275,"chars":438},{"level":2,"title":"Using server-driven paging","slug":"using-server-driven-paging","at":3713,"chars":276},{"level":2,"title":"Do not use `$top` and `$skip` query options to implement client-driven paging","slug":"do-not-use-top-and-skip-query-options-to-implement-client-driven-paging","at":3989,"chars":341},{"level":2,"title":"Timing an OData query","slug":"timing-an-odata-query","at":4330,"chars":1693},{"level":2,"title":"Related information","slug":"related-information","at":6023,"chars":118}],"text":"# OData/API web service client performance\nBusiness Central supports web services based on the OData standard (REST APIs and queries/pages/codeunits exposed as OData endpoints) to make it easier to integrate with external systems. As a developer, you need to think about performance of web services both seen from the Business Central server (the endpoint) and as seen from the consumer (the web service client that calls the endpoints).\n![Shows the three different types of web services in Business Central]\nThis article focuses on web service client performance when calling REST APIs and OData endpoints.\n## Using data access intent read-only\nBy specifying the HTTP header `Data-Access-Intent: ReadOnly` for GET requests, you can instruct Business Central to run requests against a replica of the database, which can lead to improved performance. See Specifying Data Access Intent for GET requests<../developer/devenv-connect-apps-tips#DataAccessIntent>.\n> NOTE\n> Setting the DataAccessIntent property to ReadOnly doesn't guarantee that your data access will be running on the secondary replica. It's merely stating that the code only requires read ability, so a read-only connection can be used.\n> For example, the property doesn't apply to queries running at arbitrary times during normal AL execution (that is, the server doesn't change to ReadOnly mode in the middle of a transaction). So for queries, the property only fully applies when they're exposed as an API/OData feed directly.\n## Using OData transaction `$batch`\nUse OData transaction `$batch` requests where relevant. They can reduce the number of requests the client needs to do when errors occur.\nSee Using OData transactional $batch requests<use-odata-batch>.\n## Limiting the set (`$filter` or `$top`) if you're using an expensive `$expand` statement\nLimit the result set using `$filter` or `$top` if you are using an expensive `$expand` statement. If you have moved calculated fields to a separate page, then it's good practice to limit the result set to get better performance.\n## Specifying columns in the `$select` clause\nSpecify the columns you care about in the `$select` clause. By reducing the set of properties you reference in the `$select` clause, you can reduce the number of fields that have to be read from the database. This step in itself will improve the overall performance of the query.\n> NOTE\n> Business Central supports table extensions. If you omit the `$select` clause, your query will return all fields from the table, including fields from other extensions.\n## Specifying columns in the `$select` expand option inside an `$expand` clause\nSimilarly to the `$select` clause guidelines, specify the properties in the `$select` expand option within the `$expand` clause. It is easy to forget, but if you omit it, your response will contain all the properties from the expanded object.\n## Using a filter on LastModifiedOn when you query for historical data\nWhen you query for historical data, the chances are that you're interested in the most recent period (for example, 30 days, 90 days). Because of how data audit fields are implemented in the Business Central database, there is an update of the data in the LastModifiedOn system field, which makes it perfect for history filters.\n## Using `$top` query option to limit the number of records\nQuery option `$top` is only discouraged when used together with `$skip`. If you need only a subset of records (for example, if you just want to sample some data), it is fine to use `$top` query option. Additionally, if you need to rank records according to some criteria, you should always use `$top` in combination with `$orderby` to get stable result with top ranked records.\n## Using server-driven paging\nPaging ensures that the quantity of data that is returned by an OData URI doesn't overwhelm the Business Central server or client program that you use to capture data, while optimizing performance.\nSee server-driven-paging-in-odata-web-services.\n## Do not use `$top` and `$skip` query options to implement client-driven paging\nWith other REST APIs, you might have implemented client-driven paging with `$top` and `$skip` query options. Don't use them with Business Central. There are several problems with this approach and performance is one of them. Instead, use server-driven paging.\n## Timing an OData query\nAs with any performance recommendations, you should not blindly implement them. Instead, always capture a baseline and measure the effect of changes you make. All of the guidelines above were created based on the interactions with clients of Business Central who had specific requirements and challenges. These recommendations were considered general and potentially useful for anyone who designs similar queries. However, in rare cases, following the guidelines could have no effect or even a negative effect on the performance. You do need to measure the difference to notice it.\nThere are many options to measure performance. The simplest one is to run two versions of the same query directly in the browser. Observe the time it takes in the developer tools. For example, you can use Network panel<https://learn.microsoft.com/microsoft-edge/devtools-guide/network#network-request-list> in Microsoft Edge F12 Developer Tools<https://learn.microsoft.com/microsoft-edge/devtools-guide>). Another option is to capture this information using https://learn.microsoft.com/windows/win32/win7appqual/fiddler-web-debugger-tool. You can also use Web Service Telemetry<../administration/telemetry-webservices-trace> to capture timings of OData calls. Note that only the endpoint and not the actual OData query is logged to telemetry.\nWhatever your approach is, run both queries multiple times. For example, run the queries 30 times each to have a sufficiently large sample set. Then figure out the performance characteristics. Business Central uses a multi-tenant architecture, so the duration of your queries might be affected by other operations that occur at the same time.\n## Related information\nodata-web-services\nweb-service-performance\nBusiness Central web services overview<web-services>"}