Performance considerations
- Last Updated: December 11, 2020
- 2 minute read
The following connection properties can enhance driver performance.
EnableBulkFetch: The EnableBulkfetch property can be
used to improve performance by enabling the driver to use the Salesforce Bulk API for selects.
Using the Salesforce Bulk API may significantly reduce the number of Web service calls used to
execute a statement and, therefore, may improve performance. When EnableBulkFetch has been set
to true, the driver uses the Salesforce Bulk API based on the
value of the BulkFetchThreshold connection property. If the number of rows expected in the
result set exceeds the value of BulkFetchThreshold property, the driver uses the Salesforce
Bulk API to execute the select operation.
EnablePKChunking: The EnablePKChunking property can be
used to improve performance by enabling the driver to use PK chunking for bulk fetch
operations. When EnablePKChunking is set to true, the driver
uses PK chunking to execute the operation if the expected number of rows in the result set is
greater than the values of the BulkFetchThreshold and PKChunkSize properties. For this
behavior to take effect, the EnableBulkFetch property must also be set to true.
Account, Campaign, CampaignMember, Case, Contact, Lead, LoginHistory, Opportunity, Task, and User. In addition, PK
chunking is supported for sharing objects as long as the parent object is supported.FetchSize/WSFetchSize: The connection options FetchSize and WSFetchSize can be used to adjust the trade-off between throughput and response time. In general, setting larger values for WSFetchSize and FetchSize will improve throughput, but can reduce response time.
For example, if an application attempts to fetch 100,000 rows from the remote data source and
WSFetchSize is set to 500, the driver must make 200 Web service calls to get
the 100,000 rows. If, however, WSFetchSize is set to 2000 (the maximum), the
driver only needs to make 50 Web service calls to retrieve 100,000 rows. Web service calls are
expensive, so generally, minimizing Web service calls increases throughput. In addition, many
Cloud data sources impose limits on the number of Web service calls that can be made in a
given period of time. Minimizing the number of Web service calls used to fetch data also can
help prevent exceeding the data source call limits.
For many applications, throughput is the primary performance measure, but for interactive applications, such as Web applications, response time (how fast the first set of data is returned) is more important than throughput. For example, suppose that you have a Web application that displays data 50 rows to a page and that, on average, you view three or four pages. Response time can be improved by setting FetchSize to 50 (the number of rows displayed on a page) and WSFetchSize to 200. With these settings, the driver fetches all of the rows from the remote data source that you would typically view in a single Web service call and only processes the rows needed to display the first page.