explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tCQD

Settings
# exclusive inclusive rows x rows loops node
1. 1,180.713 3,970.955 ↓ 1.1 678,869 1

Hash Join (cost=9,971.37..214,701.96 rows=642,890 width=92) (actual time=383.524..3,970.955 rows=678,869 loops=1)

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

Seq Scan on empleado (cost=0.00..136,459.10 rows=677,727 width=42) (actual time=0.059..2,406.802 rows=679,824 loops=1)

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

Hash (cost=9,466.78..9,466.78 rows=40,367 width=58) (actual time=383.440..383.440 rows=41,466 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 3686kB
4. 123.657 331.960 ↓ 1.0 41,466 1

Hash Left Join (cost=3,478.49..9,466.78 rows=40,367 width=58) (actual time=152.595..331.960 rows=41,466 loops=1)

  • Hash Cond: (cabsueldos.nropatronal = empresas_sucursales.nro_patronal)
5. 55.823 55.823 ↓ 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.032..55.823 rows=41,466 loops=1)

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

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

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

Seq Scan on empresas_sucursales (cost=0.00..2,740.81 rows=58,981 width=54) (actual time=0.006..81.189 rows=58,981 loops=1)