Query tuning with connection and startup parameters
- Last Updated: May 30, 2024
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
You can control aspects of DataServer query handling not only programmatically within ABL statements, but also through startup and connection parameter options as described in this section.
QUERY-TUNING phrase
take precedence over startup and connection parameters. For example,
if you specify NO-DEBUG for a query within your
application, specifying qt_debug,SQL at connection
time overrides the default application behavior but does not override
the NO-DEBUG option that you specified for the
query. See Query tuning for
more information.You override query-tuning defaults with the DataServer (-Dsrv)
connection parameter when you connect to a MS SQL Server database.
The syntax is:
Syntax
|
An alternate syntax for the -Dsrv parameter is as follows:
|
The following table describes the query-tuning options that you can specify with the
-Dsrv parameter.
| Option | Description |
|---|---|
|
|
Specifies whether the DataServer prints debugging information that
it generates for the query to the dataserv.lg file. The default
is qt_no_debug, to supply no debugging information. To override the
default, specify qt_debug,option as follows:
qt_debug
options, see Analyzing application execution with Enhanced Logger. |
|
|
Specifies whether the DataServer uses lookahead or standard
cursors. To generate efficient queries, qt_lookahead is the default
in the following cases:
qt_no_lookahead for query behavior that is consistent
with an OpenEdge database. |
|
|
Specifies whether each cursor should use a separate connection to
the MS SQL Server database. The default is
qt_no_separate_connection, which provides behavior that is
consistent with an OpenEdge database. Specify
qt_separate_connection to use a separate connection. Executing
cursors in separate connections can improve performance because the DataServer does
not have to restart the cursors. |
qt_cache_size,integer
|
Specifies the size in bytes of the cache used by lookahead cursors. A larger cache size can improve performance for queries that return a large number of records because the DataServer might need fewer SQL statements to get the results. Minimum: The DataServer always caches at least one record. Maximum: None. Default: 10,000 when block cursors are enabled (the default). 30,000 when block cursors are disabled. |
The following example shows how to use the query-tuning options to enhance performance. The DataServer opens a separate connection to MSS (Microsoft SQL Server) for each cursor and writes an extended report on the SQL statements it executes, as shown:
|
OpenEdge provides a startup parameter called Server Join (-nojoinbysqldb)
that controls the default JOIN-BY-SQLDB behavior. You specify this
parameter in the startup command for your OpenEdge session. It overrides the
JOIN-BY-SQLDB default so that the client evaluates and performs joins.
Using this parameter might slow performance, but it provides results that are consistent
with queries run against an OpenEdge database. See Initial Programming Considerations for more
information.