File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,13 +69,15 @@ select query_hash from sr_plans where query_hash=1000+_p(11);
6969select query_hash from sr_plans where query_hash= 1000 + _p(- 5 );
7070```
7171
72- ## Explain
72+ ## EXPLAIN for saved plans
7373
7474It is possible to see saved plans by using ` show_plan ` function. It requires
7575knowing query hash which could be fetched from ` sr_plans ` table.
7676
7777Examples:
7878
79+ Show enabled plan for query hash:
80+
7981``` SQL
8082SELECT show_plan(1 );
8183 show_plan
@@ -86,7 +88,7 @@ SELECT show_plan(1);
8688(3 rows)
8789```
8890
89- Get second plan:
91+ Get second saved plan by using ` index ` parameter (ignores ` enable ` attribute) :
9092
9193``` SQL
9294SELECT show_plan(1 , index := 2 );
@@ -98,7 +100,7 @@ SELECT show_plan(1, index := 2);
98100(3 rows)
99101```
100102
101- Use another output format (supported formats are ` json ` , ` text ` , ` xml ` ):
103+ Use another output format (supported formats are ` json ` , ` text ` , ` xml ` , ` yaml ` ):
102104
103105``` SQL
104106SELECT show_plan(1 , format := ' json' );
You can’t perform that action at this time.
0 commit comments