explain.depesz.com

PostgreSQL's explain analyze made readable

Result: u3wY

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Result (cost=3,546.59..3,546.62 rows=1 width=212) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=3,546.59..3,546.59 rows=1 width=180) (actual rows= loops=)

  • Sort Key: c.relname, i.relname
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,929.58..3,546.58 rows=1 width=180) (actual rows= loops=)

  • Join Filter: ((i.relname = i_1.relname) AND (n.nspname = n_1.nspname))
4. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,208.86..2,034.63 rows=1 width=220) (actual rows= loops=)

  • Hash Cond: (c.oid = pg_stat_all_tables.relid)
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..826.23 rows=3 width=204) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..824.10 rows=7 width=144) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..808.88 rows=32 width=72) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on pg_class i (cost=0.00..707.98 rows=43 width=68) (actual rows= loops=)

  • Filter: (pg_stat_get_numscans(oid) = 0)
9. 0.000 0.000 ↓ 0.0

Index Scan using pg_index_indexrelid_index on pg_index x (cost=0.28..2.35 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (indexrelid = i.oid)
10. 0.000 0.000 ↓ 0.0

Index Scan using pg_class_oid_index on pg_class c (cost=0.29..0.48 rows=1 width=72) (actual rows= loops=)

  • Index Cond: (oid = x.indrelid)
  • Filter: (relkind = ANY ('{r,t,m}'::"char"[]))
11. 0.000 0.000 ↓ 0.0

Index Scan using pg_namespace_oid_index on pg_namespace n (cost=0.28..0.30 rows=1 width=68) (actual rows= loops=)

  • Index Cond: (oid = c.relnamespace)
  • Filter: ((nspname <> ALL ('{pg_catalog,information_schema}'::name[])) AND (nspname !~ '^pg_toast'::text))
12. 0.000 0.000 ↓ 0.0

Hash (cost=1,195.82..1,195.82 rows=976 width=28) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Subquery Scan on pg_stat_all_tables (cost=1,168.98..1,195.82 rows=976 width=28) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,168.98..1,186.06 rows=976 width=284) (actual rows= loops=)

  • Group Key: c_2.oid, n_2.nspname, c_2.relname
15. 0.000 0.000 ↓ 0.0

Hash Join (cost=742.13..1,161.66 rows=976 width=132) (actual rows= loops=)

  • Hash Cond: (c_2.relnamespace = n_2.oid)
16. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=721.83..1,136.14 rows=1,975 width=72) (actual rows= loops=)

  • Hash Cond: (i_2.indrelid = c_2.oid)
17. 0.000 0.000 ↓ 0.0

Seq Scan on pg_index i_2 (cost=0.00..397.60 rows=6,360 width=4) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash (cost=697.14..697.14 rows=1,975 width=72) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Seq Scan on pg_class c_2 (cost=0.00..697.14 rows=1,975 width=72) (actual rows= loops=)

  • Filter: (relkind = ANY ('{r,t,m}'::"char"[]))
20. 0.000 0.000 ↓ 0.0

Hash (cost=16.71..16.71 rows=287 width=68) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on pg_namespace n_2 (cost=0.00..16.71 rows=287 width=68) (actual rows= loops=)

  • Filter: ((nspname <> ALL ('{pg_catalog,information_schema}'::name[])) AND (nspname !~ '^pg_toast'::text))
22. 0.000 0.000 ↓ 0.0

Hash Join (cost=720.72..1,503.52 rows=561 width=132) (actual rows= loops=)

  • Hash Cond: (c_1.relnamespace = n_1.oid)
23. 0.000 0.000 ↓ 0.0

Nested Loop (cost=699.65..1,480.96 rows=561 width=72) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash Join (cost=699.36..1,113.67 rows=766 width=8) (actual rows= loops=)

  • Hash Cond: (x_1.indrelid = c_1.oid)
25. 0.000 0.000 ↓ 0.0

Seq Scan on pg_index x_1 (cost=0.00..397.60 rows=6,360 width=8) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Hash (cost=686.31..686.31 rows=1,044 width=8) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Seq Scan on pg_class c_1 (cost=0.00..686.31 rows=1,044 width=8) (actual rows= loops=)

  • Filter: (relkind = ANY ('{r,m}'::"char"[]))
28. 0.000 0.000 ↓ 0.0

Index Scan using pg_class_oid_index on pg_class i_1 (cost=0.29..0.48 rows=1 width=72) (actual rows= loops=)

  • Index Cond: (oid = x_1.indexrelid)
  • Filter: ((relkind = 'i'::"char") AND (pg_get_indexdef(oid) !~* 'unique'::text))
29. 0.000 0.000 ↓ 0.0

Hash (cost=13.81..13.81 rows=581 width=68) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Seq Scan on pg_namespace n_1 (cost=0.00..13.81 rows=581 width=68) (actual rows= loops=)