explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BSAs : Optimization for: plan #vPk0i

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 22.113 27,843.648 ↓ 4.3 1,890 1

Hash Join (cost=165.57..1,504,478.48 rows=439 width=164) (actual time=30.971..27,843.648 rows=1,890 loops=1)

  • Hash Cond: (tsxpaipl4sm."tsxpaipl4smtvdID" = tvd."tvdID")
2. 3.965 21.505 ↓ 4.3 1,890 1

Hash Join (cost=164.24..2,925.38 rows=439 width=52) (actual time=15.940..21.505 rows=1,890 loops=1)

  • Hash Cond: (tsxpaipl4sm."tsxpaipl4smtmuID" = tmu."tmuID")
3. 13.881 13.881 ↓ 4.3 1,890 1

Seq Scan on "TabSICIXMLQAIPL4SM" tsxpaipl4sm (cost=0.00..2,755.11 rows=439 width=35) (actual time=12.190..13.881 rows=1,890 loops=1)

  • Filter: ("tsxpaipl4smtscID" = 29480)
  • Rows Removed by Filter: 131100
4. 1.996 3.659 ↑ 1.0 5,566 1

Hash (cost=94.66..94.66 rows=5,566 width=21) (actual time=3.659..3.659 rows=5,566 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 361kB
5. 1.663 1.663 ↑ 1.0 5,566 1

Seq Scan on "TabMunicipio" tmu (cost=0.00..94.66 rows=5,566 width=21) (actual time=0.010..1.663 rows=5,566 loops=1)

6. 0.009 0.020 ↑ 1.0 15 1

Hash (cost=1.15..1.15 rows=15 width=36) (actual time=0.020..0.020 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.011 0.011 ↑ 1.0 15 1

Seq Scan on "TabViaDistribuicao" tvd (cost=0.00..1.15 rows=15 width=36) (actual time=0.006..0.011 rows=15 loops=1)

8.          

SubPlan (forHash Join)

9. 15.120 27,800.010 ↑ 1.0 1 1,890

Aggregate (cost=3,420.36..3,420.37 rows=1 width=8) (actual time=14.708..14.709 rows=1 loops=1,890)

10. 27,784.890 27,784.890 ↓ 5.0 5 1,890

Seq Scan on "TabSICIXMLQAIPL4SM" t1 (cost=0.00..3,420.36 rows=1 width=8) (actual time=14.599..14.701 rows=5 loops=1,890)

  • Filter: (("tsxpaipl4smFaixa" IS NOT NULL) AND ("tsxpaipl4smtmuID" = tsxpaipl4sm."tsxpaipl4smtmuID") AND ("tsxpaipl4smtscID" = 29480) AND ("tsxpaipl4smtvdID" = tsxpaipl4sm."tsxpaipl4smtvdID"))
  • Rows Removed by Filter: 132985
Planning time : 0.318 ms
Execution time : 27,844.705 ms