explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FSXW

Settings
# exclusive inclusive rows x rows loops node
1. 5,527.911 39,287.308 ↑ 1.0 3,315,655 1

Merge Right Join (cost=560,945.90..640,681.96 rows=3,321,978 width=96) (actual time=21,271.972..39,287.308 rows=3,315,655 loops=1)

  • Merge Cond: ((cabsueldos.nropatronal = empleado.nropatronal) AND (cabsueldos.anho = empleado.anho))
2. 678.257 1,429.778 ↑ 1.0 279,570 1

Merge Left Join (cost=0.71..16,073.07 rows=279,570 width=62) (actual time=0.050..1,429.778 rows=279,570 loops=1)

  • Merge Cond: (cabsueldos.nropatronal = empresas_sucursales.nro_patronal)
3. 286.518 286.518 ↑ 1.0 279,570 1

Index Only Scan using uniq1 on cabsueldos (cost=0.42..5,731.97 rows=279,570 width=8) (actual time=0.026..286.518 rows=279,570 loops=1)

  • Heap Fetches: 0
4. 272.329 465.003 ↓ 4.8 283,798 1

Materialize (cost=0.29..5,659.04 rows=58,981 width=58) (actual time=0.017..465.003 rows=283,798 loops=1)

5. 192.674 192.674 ↑ 1.0 58,587 1

Index Scan using empresas_sucursales_nro_patronal_key on empresas_sucursales (cost=0.29..5,511.59 rows=58,981 width=58) (actual time=0.013..192.674 rows=58,587 loops=1)

6. 4,967.553 32,329.619 ↑ 1.0 3,315,655 1

Materialize (cost=560,945.18..577,555.07 rows=3,321,978 width=42) (actual time=21,271.914..32,329.619 rows=3,315,655 loops=1)

7. 22,631.347 27,362.066 ↑ 1.0 3,315,655 1

Sort (cost=560,945.18..569,250.13 rows=3,321,978 width=42) (actual time=21,271.910..27,362.066 rows=3,315,655 loops=1)

  • Sort Key: empleado.nropatronal, empleado.anho
  • Sort Method: external merge Disk: 184848kB
8. 4,730.719 4,730.719 ↑ 1.0 3,315,655 1

Seq Scan on empleado (cost=0.00..128,119.99 rows=3,321,978 width=42) (actual time=0.033..4,730.719 rows=3,315,655 loops=1)

  • Filter: ((documento)::text <> '0'::text)
  • Rows Removed by Filter: 37004