---
schema_version: "1"
id: e7138696db56661b1e6bf764683976691ba4e941fee1b7482d4b72d613e05622
title: Client-Driven and Server-Driven Paging in the Salesforce Connect SQL Adapter for Snowflake
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/snowflake_paging.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.snowflake_paging.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 06392409a9e814ee40ccfe9057fff396c9f131daf31ff1b8b31fc7da04400337
description: 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).
products:
  - Salesforce Platform
  - Security
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
      <colgroup>
        <col>
      </colgroup>
      <tbody>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and Lightning Experience (not for high-data-volume
            external objects)</td>

        </tr>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">
            <p>Available in: <strong>Developer</strong> Edition</p>
            <p style="margin-bottom:0;">Available for an extra cost
              in: <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong>
              Editions</p>
          </td>

        </tr>
      </tbody>
    </table>

## 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.

#### See Also

- [Salesforce Connect SQL Adapter for Snowflake](https://help.salesforce.com/s/articleView?id=platform.snowflake_sql_adapter_about.htm&release=264.0.0&type=5 "Query structured data stored in Snowflake and combine it with the customer 360-degree view captured in Salesforce.")