explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8V3v : Optimization for: plan #KdE2

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,184.798 3,666.426 ↓ 1.1 678,869 1

Hash Join (cost=10,069.70..235,771.74 rows=619,619 width=139) (actual time=419.217..3,666.426 rows=678,869 loops=1)

  • Hash Cond: (empleado.nropatronal = cabsueldos.nropatronal)
2. 2,069.117 2,069.117 ↓ 1.0 679,824 1

Seq Scan on empleado (cost=0.00..136,421.21 rows=671,391 width=42) (actual time=6.643..2,069.117 rows=679,824 loops=1)

  • Filter: (((documento)::text <> '0'::text) AND (anho = 2018))
  • Rows Removed by Filter: 2672835
3. 56.756 412.511 ↓ 1.0 41,466 1

Hash (cost=9,575.10..9,575.10 rows=39,568 width=105) (actual time=412.511..412.511 rows=41,466 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 5662kB
4. 127.323 355.755 ↓ 1.0 41,466 1

Hash Left Join (cost=3,478.47..9,575.10 rows=39,568 width=105) (actual time=162.259..355.755 rows=41,466 loops=1)

  • Hash Cond: (cabsueldos.nropatronal = empresas_sucursales.nro_patronal)
5. 66.363 66.363 ↓ 1.0 41,466 1

Index Only Scan using cabsueldos_nropatronal_anho_idx on cabsueldos (cost=0.42..5,256.23 rows=39,568 width=8) (actual time=0.104..66.363 rows=41,466 loops=1)

  • Index Cond: ((anho = 2018) AND (confirmado = 1))
  • Heap Fetches: 4709
6. 82.340 162.069 ↓ 1.0 58,981 1

Hash (cost=2,740.80..2,740.80 rows=58,980 width=97) (actual time=162.069..162.069 rows=58,981 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 7591kB
7. 79.729 79.729 ↓ 1.0 58,981 1

Seq Scan on empresas_sucursales (cost=0.00..2,740.80 rows=58,980 width=97) (actual time=0.007..79.729 rows=58,981 loops=1)