explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PuB2

Settings
# exclusive inclusive rows x rows loops node
1. 1,180.421 3,829.674 ↓ 1.1 678,869 1

Hash Join (cost=9,971.37..214,701.96 rows=642,890 width=135) (actual time=402.895..3,829.674 rows=678,869 loops=1)

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

Seq Scan on empleado (cost=0.00..136,459.10 rows=677,727 width=42) (actual time=0.078..2,246.462 rows=679,824 loops=1)

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

Hash (cost=9,466.78..9,466.78 rows=40,367 width=101) (actual time=402.791..402.791 rows=41,466 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 5439kB
4. 123.122 344.950 ↓ 1.0 41,466 1

Hash Left Join (cost=3,478.49..9,466.78 rows=40,367 width=101) (actual time=174.397..344.950 rows=41,466 loops=1)

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

Index Only Scan using cabsueldos_nropatronal_anho_idx on cabsueldos (cost=0.42..5,130.91 rows=40,367 width=8) (actual time=0.023..47.486 rows=41,466 loops=1)

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

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

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

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