explain.depesz.com

PostgreSQL's explain analyze made readable

Result: d0f2G

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

Hash Join (cost=9,945.73..214,162.41 rows=641,165 width=139) (actual time=409.785..3,706.943 rows=678,869 loops=1)

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

Seq Scan on empleado (cost=0.00..136,421.89 rows=691,641 width=42) (actual time=0.011..2,146.809 rows=679,824 loops=1)

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

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

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

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

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

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

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

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