Client-Driven and Server-Driven Paging in the Salesforce Connect SQL Adapter for
Snowflake
It’s common for Salesforce Connect queries of external data to have a large result
set that’s broken into smaller batches or pages. You decide whether to have the paging
behavior controlled by the external system (server-driven) or by the SQL adapter for
Salesforce Connect (client-driven).
Required Editions
| Available in: both Salesforce Classic and Lightning Experience (not for high-data-volume
external objects) |
|
Available in: Developer Edition
Available for an extra cost
in: Enterprise, Performance, and Unlimited
Editions
|
Server-Driven Pagination
To align with Snowflake’s recommendations, the Salesforce Connect SQL adapter uses
server-driven paging by default, and Snowflake determines the page sizes and batch
boundaries. With server-driven paging enabled, Salesforce ignores the requested
batch sizes, including the batch size specified in REST and SOAP API calls and scope
in Batch Apex. If you plan to use these features with external objects from
Snowflake, refer to the Client-Driven Pagination section.
Server-driven pagination optimizes the external system’s performance and improves the
load times for external objects in your org. Also, the external data can change
while your users or the Lightning Platform are paging through the result set.
Typically, server-driven paging adjusts batch boundaries to accommodate changing
external data more effectively than client-driven paging.
Client-Driven Pagination
The Server Driven Pagination field on the external data source specifies whether to
use client-driven or server-driven paging. When server-driven paging is disabled on
a Snowflake external data source, the requests use the $limit and $offset system query
options to page through the result set.
Client-driven paging is useful if you plan to write Apex code with custom SOQL
queries or Apex SOQL for-loops against data from a Snowflake external data source.
With these types of queries, client-driven pagination ensures that Snowflake returns
only page sizes of up to 2,000 rows.
If your implementation requires iterating over large datasets in Apex on a row-by-row
basis, we recommend that you limit the datasets by adding filters to your query.
Snowflake can contain billions of rows, and large queries can consume significant
resources.