explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Pur

Settings
# exclusive inclusive rows x rows loops node
1. 1,192.692 7,043.405 ↓ 1.1 687,966 1

Merge Left Join (cost=209,507.56..234,090.91 rows=649,690 width=139) (actual time=3,532.162..7,043.405 rows=687,966 loops=1)

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

Merge Left Join (cost=0.71..11,225.55 rows=40,367 width=105) (actual time=0.055..363.425 rows=41,466 loops=1)

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

  • Index Cond: ((anho = 2018) AND (confirmado = 1))
  • Heap Fetches: 0
4. 170.775 170.775 ↑ 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.014..170.775 rows=58,587 loops=1)

5. 1,067.649 5,487.288 ↓ 1.0 688,929 1

Materialize (cost=209,506.59..212,931.07 rows=684,896 width=42) (actual time=3,532.089..5,487.288 rows=688,929 loops=1)

6. 2,437.947 4,419.639 ↓ 1.0 688,929 1

Sort (cost=209,506.59..211,218.83 rows=684,896 width=42) (actual time=3,532.083..4,419.639 rows=688,929 loops=1)

  • Sort Key: empleado.nropatronal
  • Sort Method: external merge Disk: 38496kB
7. 1,981.692 1,981.692 ↓ 1.0 688,929 1

Seq Scan on empleado (cost=0.00..128,071.25 rows=684,896 width=42) (actual time=0.039..1,981.692 rows=688,929 loops=1)

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