-
-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
Description
Many DBMSs use a separate EXPLAIN statement to display plans. There are a number of advantages over using isc_info_sql_get_plan to get the plan:
- We can easily set the query plan output format.
- You can set other plan output options (for example, the depth of output of recursive plans)
- Plan output size is unlimited 64K
The EXPLAIN statement can return the plan as a BLOB cursor column or as isc_exec_proc (single row).
Syntax:
EXPLAIN [ ( option [, ...] ) ] statement
option :=
ANALYZE
FORMAT={PLAIN | TREE}
DEPTH=n
CARDINALITY
COST
ANALYZE - executes a query without returning data and substitutes the actual measured values into the plan
FORMAT - output format. By default TREE . PLAIN - legacy plan. TREE - tree-like (explain). In the future, it can be extended to other formats JSON, XML...
DEPTH - depth of recursive output (output of plans of internal procedures). The default is 1.
CARDINALITY - output cardinality score for plan nodes.
COST - output cost estimates for plan nodes.
livius2