explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ljxu

Settings
# exclusive inclusive rows x rows loops node
1. 50.305 2,595.519 ↓ 10,121.0 10,121 1

HashAggregate (cost=141,968.35..141,968.37 rows=1 width=4) (actual time=2,590.614..2,595.519 rows=10,121 loops=1)

  • Filter: (count(*) = 1)
  • Rows Removed by Filter: 20892
2. 37.944 2,545.214 ↓ 75,793.0 75,793 1

Nested Loop (cost=141,956.24..141,968.35 rows=1 width=4) (actual time=1,112.426..2,545.214 rows=75,793 loops=1)

3. 49.472 2,355.684 ↓ 75,793.0 75,793 1

Nested Loop (cost=141,955.94..141,964.00 rows=1 width=8) (actual time=1,112.419..2,355.684 rows=75,793 loops=1)

4. 107.754 1,162.284 ↓ 142,991.0 142,991 1

HashAggregate (cost=141,955.52..141,955.53 rows=1 width=12) (actual time=1,112.369..1,162.284 rows=142,991 loops=1)

5. 382.911 1,054.530 ↓ 144,961.0 144,961 1

Hash Join (cost=49,308.53..141,955.52 rows=1 width=12) (actual time=440.385..1,054.530 rows=144,961 loops=1)

  • Hash Cond: ((max1.max_fecha_real = h1.pos_fecha_real_ult) AND ((max1.cd_prov_ent)::text = (h1.cd_prov_ent)::text) AND ((max1.cd_mun_ent)::text = (h1.cd_mun_ent)::text) AND (max1.id_habitante = h1.id_habitante))
6. 9.656 231.798 ↓ 1.4 142,991 1

Subquery Scan on max1 (cost=0.42..26,879.92 rows=99,752 width=19) (actual time=0.075..231.798 rows=142,991 loops=1)

7. 99.047 222.142 ↓ 1.4 142,991 1

GroupAggregate (cost=0.42..25,882.40 rows=99,752 width=19) (actual time=0.074..222.142 rows=142,991 loops=1)

8. 123.095 123.095 ↑ 1.0 475,289 1

Index Only Scan using idx_phco_habpk_idreg_posfreal on phistorico h (cost=0.42..20,131.51 rows=475,337 width=19) (actual time=0.067..123.095 rows=475,289 loops=1)

  • Index Cond: ((cd_prov_ent = '46'::text) AND (cd_mun_ent = '131'::text) AND (pos_fecha_real_ult <= '2019-09-11 00:00:00'::timestamp without time zone))
  • Heap Fetches: 0
9. 133.400 439.821 ↑ 1.0 475,289 1

Hash (cost=36,551.37..36,551.37 rows=475,337 width=27) (actual time=439.821..439.821 rows=475,289 loops=1)

  • Buckets: 2048 Batches: 32 Memory Usage: 938kB
10. 306.421 306.421 ↑ 1.0 475,289 1

Seq Scan on phistorico h1 (cost=0.00..36,551.37 rows=475,337 width=27) (actual time=0.012..306.421 rows=475,289 loops=1)

11. 1,143.928 1,143.928 ↑ 1.0 1 142,991

Index Scan using indx_phco_id_prov_mun_tipo_fecha_nac on phistorico h3 (cost=0.42..8.45 rows=1 width=16) (actual time=0.008..0.008 rows=1 loops=142,991)

  • Index Cond: (id_registro = (max(h1.id_registro)))
  • Filter: (tipo_mov <> 'B'::bpchar)
  • Rows Removed by Filter: 0
12. 151.586 151.586 ↑ 1.0 1 75,793

Index Scan using phhojapadronal_pkey on phhojapadronal ph (cost=0.29..4.34 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=75,793)

  • Index Cond: (id_registro = h3.pos_id_hoja_hist)