dotConnect for Snowflake Documentation
On this page
    Performance Optimization
    On this page

    dotConnect for Snowflake communicates with the Snowflake cloud service over HTTPS. Snowflake uses virtual warehouses to execute queries that require compute resources, consuming credits while the warehouses are running.

    This topic describes how to improve application performance by reducing the number of requests, minimizing data transfer, and optimizing warehouse usage.

    Reuse Connections

    Opening a new connection requires authentication and session creation. Connection pooling eliminates this overhead by reusing existing sessions.

    Keep connection pooling enabled (the default), open connections only when needed, and close them as soon as you're finished using them to return them to the pool.

    For more information, see Sessions and Connection Pooling.

    Reduce the Number of Requests

    Each SQL statement requires a separate request to Snowflake, introducing network latency even for simple operations. To reduce the number of requests, use set-based operations instead of processing individual rows:

    Load Large Amounts of Data

    For efficient bulk data loading, use the loader classes instead of executing individual INSERT statements. The loaders upload data files to a Snowflake stage and load each batch using a single COPY INTO statement. This approach reduces the number of requests and improves data loading performance.

    For more information, see Bulk Data Loading.

    Retrieve Only the Data You Need

    Reduce the amount of data Snowflake processes and transfers to your application:

    Manage Warehouse Usage

    Snowflake executes queries that require compute resources using the warehouse specified in the Warehouse connection string parameter or the user's default warehouse.

    Snowflake bills warehouse usage per second, with a minimum of 60 seconds each time a warehouse starts. To balance query performance and compute costs, consider the following:

    Monitor Query Performance

    Use the following tools to monitor SQL execution and identify performance issues:

    To identify queries executed by a specific application, set the QUERY_TAG session parameter using the Initialization Command connection string parameter. The tag is stored in the query history, so you can find the queries of the application by it.