Show TOC

EARLY_PREDICATE_EXECUTION OptionLocate this document in the navigation structure

Controls whether simple local predicates are executed before query optimization.

Allowed Values

ON, OFF

Default

ON

Scope

Option can be set at the database (PUBLIC) or user level. At the database level, the value becomes the default for any new user, but has no impact on existing users. At the user level, overrides the PUBLIC value for that user only. No system privilege is required to set option for self. System privilege is required to set at database level or at user level for any user other than self.

Requires the SET ANY PUBLIC OPTION system privilege to set this option. Can be set temporary for an individual connection or for the PUBLIC role. Takes effect immediately.

Remarks

If this option is ON (the default), the optimizer finds, prepares, and executes predicates containing only local columns and constraints before query optimization, including join ordering, join algorithm selection, and grouping algorithm selection, so that the values of “Estimated Result Rows” in the query plan are more precise. If this option is OFF, the optimizer finds and prepares the simple predicates, but does not execute them before query optimization. The resulting values of “Estimated Result Rows” are less precise, if the predicates are not executed.

In general, EARLY_PREDICATE_EXECUTION should always be left ON, as this results in improved query plans for many queries.

Note that when EARLY_PREDICATE_EXECUTION is ON, SAP IQ executes the local predicates for all queries before generating a query plan, even when the NOEXEC option is ON. The generated query plan is the same as the runtime plan.

This information is included in the query plan for the root node:

  • Threads used for executing local invariant predicates: if greater than 1, indicates parallel execution of local invariant predicates
  • Early_Predicate_Execution: indicates if the option is OFF
  • Time of Cursor Creation: the time of cursor creation

The simple predicates whose execution is controlled by this option are referred to as invariant predicates in the query plan. This information is included in the query plan for a leaf node, if there are any local invariant predicates on the node:

  • Generated Post Invariant Predicate Rows: actual result after executing local invariant predicate
  • Estimated Post Invariant Predicate Rows: calculated by using estimated local invariant predicates selectivity
  • Time of Condition Start: starting time of the execution of local invariant predicates
  • Time of Condition Done: ending time of the execution of local invariant predicates
  • Elapsed Condition Time: elapsed time for executing local invariant predicates