The following table describes connection options related to using the Bulk API when executing selects, inserts, updates, and deletes. See "Connection option descriptions" in each driver chapter for details about configuring the options.

Table 1. Summary: Connection Options for Using Bulk API with SQL Statements
Option Characteristic
Bulk Fetch Threshold (BulkFetchThreshold) Specifies a number of rows that, if exceeded, signals the driver to use the Salesforce Bulk API for select operations. For this behavior to take effect, the Enable Bulk Fetch option must be set to 1 (enabled).

If set to 0, the driver uses the Salesforce Bulk API for all select operations.

If set to x, the driver uses the Salesforce Bulk API for select operations when the value of x is exceeded.

Default: 30000 (rows)

Bulk Load Batch Size (BulkLoadBatchSize) The number of rows that the driver sends to the database at a time during bulk operations.

Default: 1024

Bulk Load Concurrency Mode (BulkLoadConcurrencyMode)

Determines whether multiple batches associated with a bulk load operation are processed by Salesforce in parallel or one at a time.

If set to 0 (Serial), multiple batches associated with a bulk load operation are processed one at a time.

If set to 1 (Parallel), multiple batches associated with a bulk load operation are processed in parallel. The order in which the batches are processed can vary.

Default: 1 (Parallel)

Bulk Load Job Size (BulkLoadJobSize) Determines the number of rows to load into a single job of a bulk operation when BulkLoadVersion is set to V2. Performance can be improved by increasing the number of rows the driver loads at a time because fewer network round trips are required. Increasing the number of rows also causes the driver to consume more memory on the client.

Default: 150000

Bulk Load Threshold (BulkLoadThreshold) Determines when the driver uses bulk load for insert, update, and deletes.

If set to 0, the driver always uses bulk load to execute insert, update, and deletes.

If set to x, the driver only uses bulk load if the Enable Bulk Load option is set to a value of 1 (enabled) and the number of rows to be updated by an insert, update, or delete exceeds the threshold. If the operation times out, the driver returns an error.

Default: 4000

Bulk Load Version (BulkLoadVersion) Specifies which version of Salesforce Bulk Load API to be used for performing bulk load operations. This is applicable only if EnableBulkLoad is set to true.

If set to V1, the driver uses the Salesforce Bulk API V1 for all insert, update, and delete operations.

If set to V2, the driver uses the Salesforce Bulk API V2 to execute the insert, update, and delete operations.

Default: V1

Enable Bulk Fetch (EnableBulkFetch) Specifies whether the driver can use the Salesforce Bulk API for selects based on the value of the Bulk Fetch Threshold connection option.

If set to 1 (Enabled), the driver can use the Salesforce Bulk API for selects based on the value of the Bulk Fetch Threshold connection option. If the number of rows expected in the result set exceeds the value of Bulk Fetch Threshold option, the driver uses the Salesforce Bulk API to execute the select operation.

If set to 0 (Disabled), the driver does not use the Salesforce Bulk API, and the Bulk Load Threshold option is ignored.

Default: 1 (Enabled)

Note:

If there is a TOP or LIMIT clause in the select query, the driver considers the TOP or LIMIT clause value as the expected number of rows in the result set and compares it with the value of the Bulk Fetch Threshold option to choose either Bulk API or REST API for executing the select query.

If the value of TOP or LIMIT clause is greater than that of the Bulk Fetch Threshold option, but the actual row count in the result set is less, the performance of the select query might be affected adversely.

Enable Bulk Load (EnableBulkLoad) Specifies whether the driver can use the Salesforce Bulk API for inserts, updates, and deletes based on the value of the Bulk Load Threshold connection option.

If set to 1 (Enabled), the driver can use the Salesforce Bulk API for inserts, updates, and deletes based on the value of the Bulk Load Threshold connection option. If the number of affected rows exceeds the value of Bulk Load Threshold option, the driver uses the Salesforce Bulk API to execute the insert, update, or delete operation.

If set to 0 (Disabled), the driver does not use the Salesforce Bulk API, and the Bulk Load Threshold option is ignored.

Default: 1 (Enabled)

Enable Primary Key Chunking (EnablePKChunking) Specifies whether the driver uses PK chunking for select operations. PK chunking breaks down bulk fetch operations into smaller, more manageable batches for improved performance.

If set to 1 (Enabled), the driver uses PK chunking for select operations when the expected number of rows in the result set is greater than the values of the Bulk Fetch Threshold and Primary Key Chunk Size options. For this behavior to take effect, the Enable Bulk Fetch option must also be set to 1 (enabled).

If set to 0 (Disabled), the driver does not use PK chunking when executing select operations, and the Primary Key Chunk Size option is ignored.

Default: 1 (Enabled)

Primary Key Chunk Size (PKChunkSize) Specifies the size, in rows, of a primary key (PK) chunk when PK chunking has been enabled via the Enable Primary Key Chunking option. The Salesforce Bulk API splits the query into chunks of this size.

Default: 100000 (rows)