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.
QUERY-TUNING(ARRAY-MESSAGE NO-ARRAY-MESSAGEBIND-WHERE NO-BIND-WHERECACHE-SIZE integerDEBUG SQL EXTENDED diag-option NO-DEBUGINDEX-HINT NO-INDEX-HINTJOIN-BY-SQLDB NO-JOIN-BY-SQLDBLOOKAHEAD NO-LOOKAHEADORDERED-JOINREVERSE-FROMSEPARATE-CONNECTION NO-SEPARATE-CONNECTION)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-WHERESpecifies 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.CACHE-SIZE integer ROW BYTESpecifies 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.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.diag-option NO-DEBUGDEBUG SQL EXTENDEDSpecifies whether the DataServer should print debugging information for the query to the dataserv.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.EXTENDED diag-option
EXTENDED CURSOR DATA-BIND PERFORMANCE VERBOSEFor more 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).Specifies the ORACLE hint syntax that the DataServer passes directly to the ORACLE DBMS as part of the query. This allows you to control which hints are passed as opposed to the index hints that the DataServer passes when appropriate.INDEX-HINT NO-INDEX-HINTSpecifies whether the DataServer provides index hints to the ORACLE DBMS. INDEX-HINT places index hints in the generated SQL; NOINDEX-HINT prevents the use of index hints.JOIN-BY-SQLDB NO-JOIN-BY-SQLDBSpecifies whether the non-OpenEdge DBMS can perform joins when possible, which usually improves performance.LOOKAHEAD NO-LOOKAHEADSpecifies whether the DataServer uses lookahead or standard cursors. Lookahead cursors fetch as many records as can fit into the allocated cache, which reduces the number of database accesses and improves performance.Specifies that the DataServer embed the ORDERED hint syntax in the SQL it generates. Applies to ORACLE only.Specifies that tables are joined in the reverse order in which they appear in the FROM clause. Applies to ORACLE only.SEPARATE-CONNECTION NO-SEPARATE-CONNECTIONCreates a new connection for each cursor that the DataServer opens. Applies to the OpenEdge DataServer for ODBC only.The 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:
FOR EACH Customer, EACH Order OF Customer WHERE Order.OrdNum > 20BY Customer.CustNumQUERY-TUNING(LOOKAHEAD CACHE-SIZE 32768 DEBUG EXTENDED) TRANSACTION:For 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).
© 2012 Progress Software Corporation and/or its subsidiaries or affiliates. |