explain.depesz.com

PostgreSQL's explain analyze made readable

Result: d3U9

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.167 33,461.886 ↑ 3.0 23 1

Hash Join (cost=150,186.72..150,220.15 rows=69 width=32) (actual time=33,461.066..33,461.886 rows=23 loops=1)

  • Hash Cond: (a.cod_nat = b.cod_nat)
2. 1.031 1.031 ↑ 1.0 23 1

Seq Scan on reg_0400 a (cost=0.00..29.39 rows=24 width=279) (actual time=0.294..1.031 rows=23 loops=1)

  • Filter: ((cod_nat IS NOT NULL) AND (fk_0000 = 4))
  • Rows Removed by Filter: 506
3. 0.050 33,460.688 ↑ 24.0 24 1

Hash (cost=150,179.52..150,179.52 rows=576 width=15) (actual time=33,460.688..33,460.688 rows=24 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
4. 0.018 33,460.638 ↑ 24.0 24 1

Subquery Scan on b (cost=150,168.00..150,179.52 rows=576 width=15) (actual time=33,460.606..33,460.638 rows=24 loops=1)

5. 432.020 33,460.620 ↑ 24.0 24 1

HashAggregate (cost=150,168.00..150,173.76 rows=576 width=15) (actual time=33,460.603..33,460.620 rows=24 loops=1)

  • Group Key: b_1.fk_0000, b_1.cod_nat
6. 897.466 33,028.600 ↑ 1.2 267,331 1

Hash Join (cost=101,819.09..148,602.49 rows=313,102 width=15) (actual time=2,062.469..33,028.600 rows=267,331 loops=1)

  • Hash Cond: (b_1.fk_c100 = a_1.id)
7. 30,118.247 30,118.247 ↑ 1.2 267,331 1

Index Scan using reg_c170_fk_0000_idx on reg_c170 b_1 (cost=0.43..42,070.26 rows=316,510 width=19) (actual time=31.612..30,118.247 rows=267,331 loops=1)

  • Index Cond: (fk_0000 = 4)
  • Filter: (cod_nat IS NOT NULL)
8. 707.266 2,012.887 ↑ 1.0 1,514,190 1

Hash (cost=82,874.91..82,874.91 rows=1,515,500 width=4) (actual time=2,012.887..2,012.887 rows=1,514,190 loops=1)

  • Buckets: 2097152 Batches: 1 Memory Usage: 69618kB
9. 1,305.621 1,305.621 ↑ 1.0 1,514,190 1

Seq Scan on reg_c100 a_1 (cost=0.00..82,874.91 rows=1,515,500 width=4) (actual time=0.076..1,305.621 rows=1,514,190 loops=1)

  • Filter: (cod_sit <> ALL ('{02,03,04,05}'::bpchar[]))
  • Rows Removed by Filter: 16402