explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5xutB

Settings
# exclusive inclusive rows x rows loops node
1. 1,351.147 4,346.316 ↓ 1.0 678,869 1

Hash Join (cost=9,945.73..215,218.66 rows=653,733 width=139) (actual time=361.551..4,346.316 rows=678,869 loops=1)

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

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

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

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

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

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

  • Hash Cond: (cabsueldos.nropatronal = empresas_sucursales.nro_patronal)
5. 45.333 45.333 ↓ 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.022..45.333 rows=41,466 loops=1)

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

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

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