explain.depesz.com

PostgreSQL's explain analyze made readable

Result: F0l

Settings
# exclusive inclusive rows x rows loops node
1. 1,121.287 7,165.681 ↓ 1.0 687,966 1

Merge Left Join (cost=212,332.89..237,269.73 rows=663,757 width=139) (actual time=3,915.313..7,165.681 rows=687,966 loops=1)

  • Merge Cond: (cabsueldos.nropatronal = empleado.nropatronal)
  • Join Filter: (cabsueldos.anho = empleado.anho)
2. 124.015 313.621 ↓ 1.0 41,466 1

Merge Left Join (cost=0.71..11,234.09 rows=40,046 width=105) (actual time=0.061..313.621 rows=41,466 loops=1)

  • Merge Cond: (cabsueldos.nropatronal = empresas_sucursales.nro_patronal)
3. 46.081 46.081 ↓ 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..46.081 rows=41,466 loops=1)

  • Index Cond: ((anho = 2018) AND (confirmado = 1))
  • Heap Fetches: 0
4. 143.525 143.525 ↑ 1.0 58,587 1

Index Scan using empresas_sucursales_nro_patronal_key on empresas_sucursales (cost=0.29..5,511.68 rows=58,981 width=97) (actual time=0.016..143.525 rows=58,587 loops=1)

5. 1,029.794 5,730.773 ↑ 1.0 688,929 1

Materialize (cost=212,332.15..215,869.76 rows=707,523 width=42) (actual time=3,915.224..5,730.773 rows=688,929 loops=1)

6. 2,525.707 4,700.979 ↑ 1.0 688,929 1

Sort (cost=212,332.15..214,100.96 rows=707,523 width=42) (actual time=3,915.218..4,700.979 rows=688,929 loops=1)

  • Sort Key: empleado.nropatronal
  • Sort Method: external merge Disk: 38496kB
7. 2,175.272 2,175.272 ↑ 1.0 688,929 1

Seq Scan on empleado (cost=0.00..128,040.24 rows=707,523 width=42) (actual time=0.056..2,175.272 rows=688,929 loops=1)

  • Filter: (anho = 2018)
  • Rows Removed by Filter: 2663730