explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PBtj

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

Hash Join (cost=9,956.68..228,413.75 rows=657,683 width=139) (actual time=390.571..3,791.865 rows=678,869 loops=1)

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

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

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

Hash (cost=9,456.10..9,456.10 rows=40,046 width=105) (actual time=390.522..390.522 rows=41,466 loops=1)

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

Hash Left Join (cost=3,478.49..9,456.10 rows=40,046 width=105) (actual time=174.337..335.855 rows=41,466 loops=1)

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

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

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

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

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

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