QUERY_PLAN_MIN_TIME Option

Specifies a threshold for query execution. The post-query plan is generated only if query execution time exceeds the threshold.

Allowed Values

Integer, in milliseconds.

Default

0

Scope

Option can be set at the database (PUBLIC) or user level. When set at the database level, the value becomes the default for any new user, but has no impact on existing users. When set 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

A query with a very short execution time (a micro query) executes faster if a query plan is not generated. This option can be set to avoid the generation of query plans, and the associated query plan generation costs for these queries. The QUERY_PLAN_MIN_TIME option is ignored unless the following options are also set:
  • QUERY_PLAN = ON or QUERY_PLAN_AS_HTML = ON
  • QUERY_PLAN_AFTER_RUN = ON
  • QUERY_TIMING = ON
When these options are set, setting a QUERY_PLAN_MIN_TIME query execution threshold prevents the generation of query plans for queries whose execution times do not exceed the specified threshold.