explain.depesz.com

PostgreSQL's explain analyze made readable

Result: L6z

Settings
# exclusive inclusive rows x rows loops node
1. 7.729 3,513.621 ↑ 1.0 1 1

Aggregate (cost=107,391.13..107,391.13 rows=1 width=8) (actual time=3,513.621..3,513.621 rows=1 loops=1)

2. 74.342 3,505.892 ↓ 1,079.1 75,537 1

Nested Loop (cost=106,670.09..107,390.95 rows=70 width=8) (actual time=1,523.978..3,505.892 rows=75,537 loops=1)

3. 113.148 1,575.475 ↓ 1,660.2 142,775 1

HashAggregate (cost=106,669.67..106,670.53 rows=86 width=12) (actual time=1,523.919..1,575.475 rows=142,775 loops=1)

4. 676.449 1,462.327 ↓ 1,683.1 144,748 1

Hash Join (cost=48,842.06..106,669.24 rows=86 width=12) (actual time=584.618..1,462.327 rows=144,748 loops=1)

  • Hash Cond: ((h.id_habitante = h1.id_habitante) AND ((max(h.fecha_real)) = h1.fecha_real))
5. 77.306 202.538 ↓ 1.5 142,775 1

GroupAggregate (cost=0.42..23,475.93 rows=97,945 width=12) (actual time=0.093..202.538 rows=142,775 loops=1)

6. 125.232 125.232 ↑ 1.0 474,572 1

Index Only Scan using phistorico_norden6 on phistorico h (cost=0.42..20,123.49 rows=474,597 width=12) (actual time=0.086..125.232 rows=474,572 loops=1)

  • Index Cond: ((cd_prov_ent = '46'::text) AND (cd_mun_ent = '131'::text) AND (fecha_real <= '2018-12-31 00:00:00'::timestamp without time zone))
  • Heap Fetches: 0
7. 113.133 583.340 ↑ 1.0 475,288 1

Hash (cost=38,927.32..38,927.32 rows=475,288 width=20) (actual time=583.340..583.340 rows=475,288 loops=1)

  • Buckets: 2048 Batches: 32 Memory Usage: 831kB
8. 470.207 470.207 ↑ 1.0 475,288 1

Seq Scan on phistorico h1 (cost=0.00..38,927.32 rows=475,288 width=20) (actual time=0.019..470.207 rows=475,288 loops=1)

  • Filter: (((cd_prov_ent)::text = '46'::text) AND ((cd_mun_ent)::text = '131'::text))
9. 1,856.075 1,856.075 ↑ 1.0 1 142,775

Index Scan using phistorico_norden1 on phistorico h3 (cost=0.42..8.36 rows=1 width=8) (actual time=0.013..0.013 rows=1 loops=142,775)

  • Index Cond: (id_registro = (max(h1.id_registro)))
  • Filter: ((tipo_mov <> 'B'::bpchar) AND ((cd_prov_ent)::text = '46'::text) AND ((cd_mun_ent)::text = '131'::text))
  • Rows Removed by Filter: 0