File: pg_show_plans.sql

package info (click to toggle)
pg-show-plans 2.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 172 kB
  • sloc: ansic: 527; sql: 86; makefile: 27; sh: 1
file content (21 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
create extension pg_show_plans;

show pg_show_plans.is_enabled;
show pg_show_plans.max_plan_length;

create function nest()
  returns table (level int, plan text)
  language plpgsql
as $$
  begin
    return query
      select pg_show_plans.level, pg_show_plans.plan from pg_show_plans
        where pg_show_plans.level >= 0;
  end;
$$;

-- text output
set pg_show_plans.plan_format = 'text';
show pg_show_plans.plan_format;
select level, plan from pg_show_plans;
select * from nest();