explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KdE2

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,179.082 4,092.449 ↓ 1.1 678,869 1

Hash Join (cost=11,684.97..237,387.00 rows=619,619 width=139) (actual time=497.298..4,092.449 rows=678,869 loops=1)

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

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

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

Hash (cost=11,190.64..11,190.64 rows=39,546 width=105) (actual time=488.590..488.590 rows=41,466 loops=1)

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

Hash Left Join (cost=3,478.05..11,190.64 rows=39,546 width=105) (actual time=197.829..429.564 rows=41,466 loops=1)

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

Seq Scan on cabsueldos (cost=0.00..6,872.24 rows=39,546 width=8) (actual time=0.536..102.413 rows=41,466 loops=1)

  • Filter: ((anho = 2018) AND (confirmado = 1))
  • Rows Removed by Filter: 238104
6. 94.957 197.263 ↓ 1.0 58,981 1

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

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

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