Optimizer Directives

The Optimizer Directives segment specifies keywords that you can use to partially or fully specify the query plan of the optimizer. Use this segment whenever you see a reference to Optimizer Directives in a syntax diagram.

Syntax

Read syntax diagramSkip visual syntax diagram
Optimizer Directives

             .-,----------------------------------------.   
             V                                (1)       |   
|--+- --+ +----+-| Access-Method Directives |---------+-+------->
   +-{+ --+    |                          (2)         |     
   '-/*+ -'    +-| Join-Order Directive |-------------+     
               |                            (3)       |     
               +-| Join-Method Directives |-----------+     
               |                          (4)         |     
               +-| Star-Join Directives |-------------+     
               |                                  (5) |     
               +-| Optimization-Goal Directives |-----+     
               |                             (6)      |     
               +-| Explain-Mode Directives |----------+     
               |                               (7)    |     
               '-| Statement cache directive |--------'     

>--+-----+------------------------------------------------------|
   +-}---+   
   '- */ '   

Notes:
  1. See Access-Method Directives
  2. See Join-Order Directive
  3. See Join-Method Directives
  4. See Star-Join Directives
  5. See Optimization-Goal Directives
  6. See Explain-Mode Directives
  7. See Statement cache directive

Usage

Use one or more optimizer directives to partially or fully specify the query plan of the optimizer. The scope of the directive is the current query only.

Directives are enabled by default. To obtain information about how specified directives are processed, view the output of the SET EXPLAIN statement. To disable directives, set the IFX_DIRECTIVES environment variable to 0, or set the DIRECTIVES parameter in the ONCONFIG file to 0.

The syntax diagram above is simplified, and does not show that the closing comment indicator must follow the same comment style as the opening comment indicator. For more information, see Optimizer Directives as Comments.