explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3ZGE

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 37,232.677 ↑ 1.0 1 1

Aggregate (cost=6,267.87..6,267.88 rows=1 width=0) (actual time=37,232.673..37,232.677 rows=1 loops=1)

2. 302.509 37,232.655 ↓ 0.0 0 1

Nested Loop (cost=1.15..6,267.87 rows=1 width=0) (actual time=37,232.655..37,232.655 rows=0 loops=1)

3. 577.927 2,407.471 ↓ 29,381.0 29,381 1

Nested Loop (cost=0.86..5,994.68 rows=1 width=92) (actual time=0.471..2,407.471 rows=29,381 loops=1)

4. 310.545 1,447.591 ↓ 5,876.2 29,381 1

GroupAggregate (cost=0.57..5,953.03 rows=5 width=12) (actual time=0.425..1,447.591 rows=29,381 loops=1)

5. 482.470 1,137.046 ↓ 5,953.6 29,768 1

Merge Join (cost=0.57..5,952.96 rows=5 width=12) (actual time=0.278..1,137.046 rows=29,768 loops=1)

  • Merge Cond: (phh.cd_hoja = phh1.cd_hoja)
  • Join Filter: (phh1.fecha_vigencia = (max(phh.fecha_vigencia)))
  • Rows Removed by Join Filter: 2756
6. 319.913 487.921 ↓ 1.0 29,381 1

GroupAggregate (cost=0.29..1,450.31 rows=29,154 width=12) (actual time=0.204..487.921 rows=29,381 loops=1)

7. 168.008 168.008 ↑ 1.0 32,524 1

Index Only Scan using phh_hoja_fecha_vigencia on phhojapadronal phh (cost=0.29..996.15 rows=32,524 width=12) (actual time=0.031..168.008 rows=32,524 loops=1)

  • Heap Fetches: 0
8. 166.655 166.655 ↑ 1.0 32,524 1

Index Scan using phh_hoja_fecha_vigencia on phhojapadronal phh1 (cost=0.29..3,650.36 rows=32,524 width=20) (actual time=0.018..166.655 rows=32,524 loops=1)

9. 381.953 381.953 ↑ 1.0 1 29,381

Index Scan using phh_hoja_fecha_vigencia on phhojapadronal phh3 (cost=0.29..8.31 rows=1 width=96) (actual time=0.008..0.013 rows=1 loops=29,381)

  • Index Cond: (cd_hoja = phh1.cd_hoja)
  • Filter: ((max(phh1.id_registro)) = id_registro)
  • Rows Removed by Filter: 0
10. 34,522.675 34,522.675 ↓ 0.0 0 29,381

Index Scan using phojapadronal_pkey on phojapadronal ph (cost=0.29..273.18 rows=1 width=117) (actual time=1.175..1.175 rows=0 loops=29,381)

  • Index Cond: (cd_hoja = phh3.cd_hoja)
  • Filter: ((cd_tipo_hoja <> phh3.cd_tipo_hoja) OR ((numro_hoja)::text <> (phh3.numro_hoja)::text) OR (cd_tramo <> phh3.cd_tramo) OR ((cd_esclra)::text <> (phh3.cd_esclra)::text) OR ((cd_planta)::text <> (phh3.cd_planta)::text) OR ((numero)::tex (...)
  • Rows Removed by Filter: 1