explain.depesz.com

PostgreSQL's explain analyze made readable

Result: b45K : Optimization for: Optimization for: plan #KdE2; plan #8V3v

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 1,189.177 3,833.621 ↓ 1.1 678,869 1

Hash Join (cost=9,945.73..211,913.39 rows=622,905 width=139) (actual time=424.665..3,833.621 rows=678,869 loops=1)

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

Seq Scan on empleado (cost=0.00..136,470.56 rows=667,809 width=42) (actual time=0.013..2,219.820 rows=679,824 loops=1)

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

Hash (cost=9,448.47..9,448.47 rows=39,781 width=105) (actual time=424.624..424.624 rows=41,466 loops=1)

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

Hash Left Join (cost=3,478.49..9,448.47 rows=39,781 width=105) (actual time=180.709..364.585 rows=41,466 loops=1)

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

Index Only Scan using cabsueldos_nropatronal_anho_idx on cabsueldos (cost=0.42..5,125.05 rows=39,781 width=8) (actual time=0.024..49.299 rows=41,466 loops=1)

  • Index Cond: ((anho = 2018) AND (confirmado = 1))
  • Heap Fetches: 0
6. 92.356 180.653 ↑ 1.0 58,981 1

Hash (cost=2,740.81..2,740.81 rows=58,981 width=97) (actual time=180.653..180.653 rows=58,981 loops=1)

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

Seq Scan on empresas_sucursales (cost=0.00..2,740.81 rows=58,981 width=97) (actual time=0.005..88.297 rows=58,981 loops=1)