Configuring Query Processing Modes
To optimize connector performance, you can modify how the connector runs queries and retrieves results into memory. For example, you can configure the connector to return entire query results into memory all at once, or one row at a time. Use a query processing mode that prevents queries from consuming too much memory, based on the expected result size of your queries and the specifications of your system.
Note:
Use Single Row Mode if you plan to query large results and you do not want to retrieve the entire result into memory. Using the other query processing modes increases performance, but can result in out-of-memory errors.
You can set the connection properties described below in a connection string or in a DSN (in the odbc.ini
file). Settings in the connection string take precedence over
settings in the DSN.
Enabling Single Row Mode
You can configure the connector to return query results one row at a time.
To enable Single Row Mode:
- Set the
SingleRowMode
property to1
. - Make sure that the
UseDeclareFetch
property is set to0
or not set.
Enabling Declare/Fetch Mode
You can configure the connector to return a specific number of rows at a time.
To enable Declare/Fetch Mode:
- Set the
UseDeclareFetch
property to1
. - Set the
Fetch
property to the number of rows that the connector returns at a time.
Enabling Retrieve Entire Result Mode
You can configure the connector to return entire query results into memory.
To enable Retrieve Entire Result Mode:
- Make sure that the
SingleRowMode
,UseDeclareFetch
, andUseMultipleStatements
properties are set to0
or not set.
Enabling Multiple Statements Mode
The connector can have more than one query, separated by a semicolon ( ;
), in a single SQLExecDirect call. The connector returns all the query results into memory.
To enable Multiple Statements Mode:
- Set the
UseMultipleStatements
property to1
. -
Make sure that the
SingleRowMode
andUseDeclareFetch
properties are set to0
or not set.
Enabling Enforce Single Statement Mode
You can configure the connector to return SQL_ERROR immediately for any other queries that is executed if there is already an active query in execution under the same connection.
To enable Enforce Single Statement Mode:
- Set the
EnforceSingleStatement
property to1
. - Make sure that the
UseMultipleStatements
is set to0
or not set.
- Enforce Single Statement
- Cache Size
- Single Row Mode
- Use Declare/Fetch
- Use Multiple Statements
- Query Processing Modes
- Configuring the Driver on page 1