QUERY-TUNING phrase
Allows programmatic control over the execution of a query in a DataServer application. This phrase is available for the DataServers; it is not available for queries of OpenEdge databases.
Syntax
The following descriptions are general. For more detailed information, see the OpenEdge DataServer Guides (OpenEdge Data Management: DataServer for Microsoft SQL Server, OpenEdge Data Management: DataServer for ODBC, and OpenEdge Data Management: DataServer for Oracle).
ARRAY-MESSAGE | NO-ARRAY-MESSAGEBIND-WHERE | NO-BIND-WHERE
This option is available only for the DataServer for ORACLE.Specifies whether the DataServer uses ORACLE bind variables or literals in WHERE clauses. If you use NO-BIND-WHERE, the DataServer uses literals. Bind variables can improve performance, but ORACLE produces some unexpected results for some data types.The default is BIND-WHERE.CACHE-SIZEinteger
[ROW|BYTE]
Specifies the maximum cache size the DataServer can use when fetching records for a lookahead or standard cursor. You can optionally specify the size of the cache information in either bytes or records. The following values are for ORACLE.The default is 1024 for standard cursors and 8192 for lookahead cursors.If you use the byte option, the byte maximum is 65535 bytes and the byte minimum specifies the number of bytes contained in a single record. For joins, you must specify the number of bytes contained in two records.If you use the row option, the row maximum equals the maximum number of records that can be fit in 65535 bytes. The row minimum is 1 row for a single table and 1 rows for a join.The default is 30000.{ DEBUG { SQL|EXTENDEDdiag-option
} } | NO-DEBUG
Specifies whether the DataServer should print debugging information for the query to thedataserv.lg
file.The SQL option prints the SQL executed by the DataServer against the non-OpenEdge DBMS. The extended option prints additional information, such as cursor statistics. The information you get when you use the EXTENDED option can be helpful in setting your parameters.The default is NO-DEBUG.EXTENDEDdiag-option
HINTINDEX-HINT | NO-INDEX-HINTJOIN-BY-SQLDB | NO-JOIN-BY-SQLDBLOOKAHEAD | NO-LOOKAHEADORDERED-JOINREVERSE-FROMSEPARATE-CONNECTION | NO-SEPARATE-CONNECTIONExampleThe following code fragment illustrates a QUERY-TUNING phrase in a FOR EACH statement. In this example, the DataServer uses lookahead cursors with a cache size of 32K and records debugging information:
NoteFor the DataServer for ORACLE, all options of the QUERY-TUNING phrase are effective at both compile and run time, except INDEX-HINT, NO-INDEX-HINT, JOIN-BY-SQLDB, and NO-JOIN-BY-SQLDB, which are only effective at compile time.
For more information on the QUERY-TUNING phrase, see the OpenEdge DataServer Guides (OpenEdge Data Management: DataServer for Microsoft SQL Server, OpenEdge Data Management: DataServer for ODBC, and OpenEdge Data Management: DataServer for Oracle).
See alsoDO statement, FOR statement, OPEN QUERY statement, REPEAT statement
OpenEdge Release 10.2B
|