PreviousNextIndex

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

QUERY-TUNING 
  ( 
    { [ ARRAY-MESSAGE | NO-ARRAY-MESSAGE ] 
      [ BIND-WHERE | NO-BIND-WHERE ] 
      [ CACHE-SIZE integer ] 
      [ DEBUG { SQL | EXTENDED diag-option } | NO-DEBUG ] 
      [ INDEX-HINT | NO-INDEX-HINT ] 
      [ JOIN-BY-SQLDB | NO-JOIN-BY-SQLDB ] 
      [ LOOKAHEAD | NO-LOOKAHEAD ] 
      [ ORDERED-JOIN ] 
      [ REVERSE-FROM ] 
      [ SEPARATE-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-MESSAGE
BIND-WHERE | NO-BIND-WHERE
CACHE-SIZE integer[ROW|BYTE]
{ DEBUG { SQL|EXTENDED diag-option } } | NO-DEBUG
EXTENDED diag-option
HINT
INDEX-HINT | NO-INDEX-HINT
JOIN-BY-SQLDB | NO-JOIN-BY-SQLDB
LOOKAHEAD | NO-LOOKAHEAD
ORDERED-JOIN
REVERSE-FROM
SEPARATE-CONNECTION | NO-SEPARATE-CONNECTION
Example

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 > 20 
  BY Customer.CustNum 
  QUERY-TUNING(LOOKAHEAD CACHE-SIZE 32768 DEBUG EXTENDED) TRANSACTION: 

Note

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).

See also

DO statement, FOR statement, OPEN QUERY statement, REPEAT statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex