explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Og51

Settings
# exclusive inclusive rows x rows loops node
1. 8.000 3,605.669 ↑ 1.0 1 1

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

2. 84.506 3,597.669 ↓ 1,079.1 75,537 1

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

3. 117.356 1,657.088 ↓ 1,660.2 142,775 1

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

4. 717.424 1,539.732 ↓ 1,683.1 144,748 1

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

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

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

6. 128.777 128.777 ↑ 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.081..128.777 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. 120.656 612.622 ↑ 1.0 475,288 1

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

  • Buckets: 2048 Batches: 32 Memory Usage: 831kB
8. 491.966 491.966 ↑ 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..491.966 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