explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XkKk

Settings
# exclusive inclusive rows x rows loops node
1. 1,144.595 3,542.503 ↓ 1.0 678,869 1

Hash Join (cost=9,947.40..227,510.50 rows=655,917 width=139) (actual time=361.367..3,542.503 rows=678,869 loops=1)

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

Seq Scan on empleado (cost=0.00..136,517.58 rows=701,048 width=42) (actual time=0.059..2,036.622 rows=679,824 loops=1)

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

Hash (cost=9,449.29..9,449.29 rows=39,849 width=105) (actual time=361.286..361.286 rows=41,466 loops=1)

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

Hash Left Join (cost=3,478.49..9,449.29 rows=39,849 width=105) (actual time=157.027..310.404 rows=41,466 loops=1)

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

Index Only Scan using cabsueldos_nropatronal_anho_idx on cabsueldos (cost=0.42..5,124.42 rows=39,849 width=8) (actual time=0.021..42.951 rows=41,466 loops=1)

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

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

  • Buckets: 8192 Batches: 1 Memory Usage: 7591kB
7. 83.384 83.384 ↑ 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..83.384 rows=58,981 loops=1)