skip to main content
Using the Driver : Configuring and Connecting to Data Sources : Performance Considerations
  

Try DataDirect Drivers Now

Performance Considerations

The following connection options can affect driver performance. You can also enhance performance through efficient application design. See "Designing ODBC Applications for Performance Optimization" for details.
Always Encrypted: The following options related to the Always Encrypted feature affect performance:
*Column Encryption (ColumnEncryption): Due to the overhead associated with encrypting and decrypting data, the Always Encrypted functionality can adversely affect performance when enabled (ColumnEncryption=Enabled | ResultsetOnly). You can mitigate the performance impact of Always Encrypted depending on your use case:
*If your application only needs to retrieve and decrypt columns, you can improve performance over the behavior of the Enabled setting by specifying a value of ResultsetOnly. In this setting, Always Encrypted behavior is enabled only when returning result sets. Queries containing parameters that affect encrypted columns will return an error.
*If your application only occasionally needs to encrypt or decrypt columns, you can override the Column Encryption option by setting a value for the SQL_SOPT_SS_COLUMN_ENCRYPTION statement attribute for a statement. SQL_SOPT_SS_COLUMN_ENCRYPTION allows you to toggle support for Always Encrypted without having to establish a new connection, thereby reducing the performance impact when you are not using the feature. Note that the statement attribute is only supported when ColumnEncryption=Enabled | ResultsetOnly. See "Always Encrypted" for details.
*Key Cache Time To Live (AEKeyCacheTTL): When Always Encrypted functionality is enabled (ColumnEncryption=Enabled | ResultsetOnly), you can determine whether column encryption keys are cached using the Key Cache Time To Live option. Caching column encryption keys can provide performance gains by eliminating the overhead associated with fetching and decrypting keys for the same data multiple times during a connection. Note that column encryption keys are designed to be deleted from the cache as a security measure. Therefore, we do not recommend caching column encryption keys for applications that remain connected for long periods of time.
Connection Pooling (Pooling): If you enable the driver to use connection pooling, you can set additional options that affect performance:
*Load Balance Timeout (LoadBalanceTimeout): You can define how long to keep connections in the pool. The time that a connection was last used is compared to the current time and, if the timespan exceeds the value of the Load Balance Timeout option, the connection is destroyed. The Min Pool Size option can cause some connections to ignore this value.
*Connection Reset (ConnectionReset): Resetting a re-used connection to the initial configuration settings impacts performance negatively because the connection must issue additional commands to the server.
*Max Pool Size (MaxPoolSize): Setting the maximum number of connections that the pool can contain too low might cause delays while waiting for a connection to become available. Setting the number too high wastes resources.
*Min Pool Size (MinPoolSize): A connection pool is created when the first connection with a unique connection string connects to the database. The pool is populated with connections up to the minimum pool size, if one has been specified. The connection pool retains this number of connections, even when some connections exceed their Load Balance Timeout value.
Enable Bulk Load (EnableBulkLoad): If your application performs bulk loading of data, you can improve performance by configuring the driver to use the database system's bulk load functionality instead of database array binding. The trade-off to consider for improved performance is that using the bulk load functionality can bypass data integrity constraints.
Enable Server Side Cursors (EnableServersideCursors): Employing scrollable cursors are more expensive than using forward-only cursors, and, therefore, can adversely impact performance. If your application does not always require the use of scrollable cursors, you can restrict the use of server-side scrollable cursors using the Enable Server Side Cursors option. For best performance, you can disable all server-side scrollable cursors by setting EnableServersideCursors=0.
Encryption Method (EncryptionMethod): Data encryption may adversely affect performance because of the additional overhead (mainly CPU usage) that is required to encrypt and decrypt data.
Failover Mode (FailoverMode): Although high availability that replays queries after a failure provides increased levels of protection, it can adversely affect performance because of increased overhead.
Packet Size (PacketSize): Typically, it is optimal for the client to use the maximum packet size that the database server allows. This reduces the total number of round trips required to return data to the client, thus improving performance. Therefore, performance can be improved if the PacketSize attribute is set to the maximum packet size of the server.
Use Snapshot Transactions (SnapshotSerializable): You must have your Microsoft SQL Server 2005 and higher database configured for snapshot isolation for this connection option to work. Snapshot Isolation provides transaction-level read consistency and an optimistic approach to data modifications by not acquiring locks on data until data is to be modified. This Microsoft SQL Server 2005 and higher feature can be useful if you want to consistently return the same result set even if another transaction has changed the data and 1) your application executes many read operations or 2) your application has long running transactions that could potentially block users from reading data. This feature has the potential to eliminate data contention between read operations and update operations. When this connection option is enabled, performance is improved due to increased concurrency.
See "Using the Snapshot Isolation Level" for details.