explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4GLP

Settings
# exclusive inclusive rows x rows loops node
1. 2,735.434 17,224.155 ↓ 1.1 678,930 1

Hash Join (cost=8,838.14..220,403.76 rows=608,217 width=92) (actual time=1,357.559..17,224.155 rows=678,930 loops=1)

  • Hash Cond: (empleado.nropatronal = cabsueldos.nropatronal)
2. 13,131.819 13,131.819 ↑ 1.0 679,885 1

Seq Scan on empleado (cost=0.00..136,307.12 rows=683,223 width=42) (actual time=0.620..13,131.819 rows=679,885 loops=1)

  • Filter: (((documento)::text <> '0'::text) AND (anho = 2018))
  • Rows Removed by Filter: 2672866
3. 130.539 1,356.902 ↓ 1.1 41,469 1

Hash (cost=8,362.69..8,362.69 rows=38,036 width=58) (actual time=1,356.902..1,356.902 rows=41,469 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 3686kB
4. 317.135 1,226.363 ↓ 1.1 41,469 1

Hash Left Join (cost=4,275.22..8,362.69 rows=38,036 width=58) (actual time=728.932..1,226.363 rows=41,469 loops=1)

  • Hash Cond: (cabsueldos.nropatronal = empresas_sucursales.nro_patronal)
5. 180.573 202.628 ↓ 1.1 41,469 1

Bitmap Heap Scan on cabsueldos (cost=796.61..4,075.81 rows=38,036 width=8) (actual time=22.298..202.628 rows=41,469 loops=1)

  • Recheck Cond: (anho = 2018)
  • Filter: (confirmado = 1)
  • Rows Removed by Filter: 652
6. 22.055 22.055 ↓ 1.1 42,121 1

Bitmap Index Scan on cabsueldos_anho_idx (cost=0.00..787.10 rows=39,880 width=0) (actual time=22.055..22.055 rows=42,121 loops=1)

  • Index Cond: (anho = 2018)
7. 236.591 706.600 ↑ 1.0 59,005 1

Hash (cost=2,741.05..2,741.05 rows=59,005 width=54) (actual time=706.600..706.600 rows=59,005 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 5090kB
8. 470.009 470.009 ↑ 1.0 59,005 1

Seq Scan on empresas_sucursales (cost=0.00..2,741.05 rows=59,005 width=54) (actual time=0.025..470.009 rows=59,005 loops=1)