|
| 1 | +-- explain output on PG12/13 is missing "Async Capable" |
| 2 | +select setting::int < 140000 as pg12_13 from pg_settings where name = 'server_version_num'; |
| 3 | + pg12_13 |
| 4 | +--------- |
| 5 | + t |
| 6 | +(1 row) |
| 7 | + |
| 8 | +-- json output |
| 9 | +set pg_show_plans.plan_format = 'json'; |
| 10 | +show pg_show_plans.plan_format; |
| 11 | + pg_show_plans.plan_format |
| 12 | +--------------------------- |
| 13 | + json |
| 14 | +(1 row) |
| 15 | + |
| 16 | +select * from nest(); |
| 17 | + level | plan |
| 18 | +-------+--------------------------------------- |
| 19 | + 0 | [ + |
| 20 | + | "Plan": { + |
| 21 | + | "Node Type": "Function Scan", + |
| 22 | + | "Parallel Aware": false, + |
| 23 | + | "Function Name": "nest", + |
| 24 | + | "Alias": "nest", + |
| 25 | + | "Startup Cost": 0.25, + |
| 26 | + | "Total Cost": 10.25, + |
| 27 | + | "Plan Rows": 1000, + |
| 28 | + | "Plan Width": 36 + |
| 29 | + | } + |
| 30 | + | ] |
| 31 | + 1 | [ + |
| 32 | + | "Plan": { + |
| 33 | + | "Node Type": "Function Scan", + |
| 34 | + | "Parallel Aware": false, + |
| 35 | + | "Function Name": "pg_show_plans",+ |
| 36 | + | "Alias": "pg_show_plans", + |
| 37 | + | "Startup Cost": 0.00, + |
| 38 | + | "Total Cost": 12.50, + |
| 39 | + | "Plan Rows": 333, + |
| 40 | + | "Plan Width": 36, + |
| 41 | + | "Filter": "(level >= 0)" + |
| 42 | + | } + |
| 43 | + | ] |
| 44 | +(2 rows) |
| 45 | + |
| 46 | +-- yaml output |
| 47 | +set pg_show_plans.plan_format = 'yaml'; |
| 48 | +show pg_show_plans.plan_format; |
| 49 | + pg_show_plans.plan_format |
| 50 | +--------------------------- |
| 51 | + yaml |
| 52 | +(1 row) |
| 53 | + |
| 54 | +select * from nest(); |
| 55 | + level | plan |
| 56 | +-------+---------------------------------- |
| 57 | + 0 | Plan: + |
| 58 | + | Node Type: "Function Scan" + |
| 59 | + | Parallel Aware: false + |
| 60 | + | Function Name: "nest" + |
| 61 | + | Alias: "nest" + |
| 62 | + | Startup Cost: 0.25 + |
| 63 | + | Total Cost: 10.25 + |
| 64 | + | Plan Rows: 1000 + |
| 65 | + | Plan Width: 36 |
| 66 | + 1 | Plan: + |
| 67 | + | Node Type: "Function Scan" + |
| 68 | + | Parallel Aware: false + |
| 69 | + | Function Name: "pg_show_plans"+ |
| 70 | + | Alias: "pg_show_plans" + |
| 71 | + | Startup Cost: 0.00 + |
| 72 | + | Total Cost: 12.50 + |
| 73 | + | Plan Rows: 333 + |
| 74 | + | Plan Width: 36 + |
| 75 | + | Filter: "(level >= 0)" |
| 76 | +(2 rows) |
| 77 | + |
| 78 | +-- xml output |
| 79 | +set pg_show_plans.plan_format = 'xml'; |
| 80 | +show pg_show_plans.plan_format; |
| 81 | + pg_show_plans.plan_format |
| 82 | +--------------------------- |
| 83 | + xml |
| 84 | +(1 row) |
| 85 | + |
| 86 | +select * from nest(); |
| 87 | + level | plan |
| 88 | +-------+---------------------------------------------------------- |
| 89 | + 0 | <explain xmlns="http://www.postgresql.org/2009/explain">+ |
| 90 | + | <Plan> + |
| 91 | + | <Node-Type>Function Scan</Node-Type> + |
| 92 | + | <Parallel-Aware>false</Parallel-Aware> + |
| 93 | + | <Function-Name>nest</Function-Name> + |
| 94 | + | <Alias>nest</Alias> + |
| 95 | + | <Startup-Cost>0.25</Startup-Cost> + |
| 96 | + | <Total-Cost>10.25</Total-Cost> + |
| 97 | + | <Plan-Rows>1000</Plan-Rows> + |
| 98 | + | <Plan-Width>36</Plan-Width> + |
| 99 | + | </Plan> + |
| 100 | + | </explain> |
| 101 | + 1 | <explain xmlns="http://www.postgresql.org/2009/explain">+ |
| 102 | + | <Plan> + |
| 103 | + | <Node-Type>Function Scan</Node-Type> + |
| 104 | + | <Parallel-Aware>false</Parallel-Aware> + |
| 105 | + | <Function-Name>pg_show_plans</Function-Name> + |
| 106 | + | <Alias>pg_show_plans</Alias> + |
| 107 | + | <Startup-Cost>0.00</Startup-Cost> + |
| 108 | + | <Total-Cost>12.50</Total-Cost> + |
| 109 | + | <Plan-Rows>333</Plan-Rows> + |
| 110 | + | <Plan-Width>36</Plan-Width> + |
| 111 | + | <Filter>(level >= 0)</Filter> + |
| 112 | + | </Plan> + |
| 113 | + | </explain> |
| 114 | +(2 rows) |
| 115 | + |
| 116 | +-- check plan format after reconnect |
| 117 | +\c |
| 118 | +show pg_show_plans.plan_format; |
| 119 | + pg_show_plans.plan_format |
| 120 | +--------------------------- |
| 121 | + xml |
| 122 | +(1 row) |
| 123 | + |
0 commit comments