explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NBQO

Settings
# exclusive inclusive rows x rows loops node
1. 484.787 36,347.374 ↓ 1.3 1,913,787 1

Hash Join (cost=736,948.05..2,427,943.00 rows=1,446,760 width=56) (actual time=10,250.951..36,347.374 rows=1,913,787 loops=1)

  • Hash Cond: (s.regimen_afiliacion_id = ra.id)
2. 523.184 35,862.569 ↓ 1.3 1,913,787 1

Hash Join (cost=736,947.00..2,408,049.00 rows=1,446,760 width=44) (actual time=10,250.879..35,862.569 rows=1,913,787 loops=1)

  • Hash Cond: (v.tipo_valorizacion = tv.id)
3. 299.825 35,339.374 ↓ 1.3 1,913,787 1

Nested Loop (cost=736,945.80..2,388,154.85 rows=1,446,760 width=26) (actual time=10,250.824..35,339.374 rows=1,913,787 loops=1)

4. 3,348.623 27,384.401 ↓ 1.3 1,913,787 1

Hash Join (cost=736,945.36..1,527,035.58 rows=1,446,760 width=26) (actual time=10,250.747..27,384.401 rows=1,913,787 loops=1)

  • Hash Cond: (si.autorizacion_id = a.id)
5. 11,942.023 15,288.579 ↓ 1.0 1,960,478 1

Hash Join (cost=114,277.39..853,215.95 rows=1,956,483 width=18) (actual time=1,415.545..15,288.579 rows=1,960,478 loops=1)

  • Hash Cond: (si.id = v.solicitud_item_id)
6. 1,942.863 1,942.863 ↓ 1.0 21,401,051 1

Seq Scan on solicitud_item si (cost=0.00..612,417.82 rows=21,391,182 width=12) (actual time=0.005..1,942.863 rows=21,401,051 loops=1)

7. 658.433 1,403.693 ↓ 1.0 1,960,478 1

Hash (cost=89,821.35..89,821.35 rows=1,956,483 width=14) (actual time=1,403.693..1,403.693 rows=1,960,478 loops=1)

  • Buckets: 2097152 Batches: 1 Memory Usage: 105796kB
8. 745.260 745.260 ↓ 1.0 1,960,478 1

Seq Scan on valorizacion v (cost=0.00..89,821.35 rows=1,956,483 width=14) (actual time=0.021..745.260 rows=1,960,478 loops=1)

  • Filter: (tipo_valorizacion <> 1)
  • Rows Removed by Filter: 1963831
9. 4,865.979 8,747.199 ↓ 1.0 13,348,527 1

Hash (cost=455,983.18..455,983.18 rows=13,334,784 width=16) (actual time=8,747.199..8,747.199 rows=13,348,527 loops=1)

  • Buckets: 16777216 Batches: 1 Memory Usage: 808927kB
10. 3,881.220 3,881.220 ↓ 1.0 13,348,527 1

Seq Scan on autorizacion a (cost=0.00..455,983.18 rows=13,334,784 width=16) (actual time=0.048..3,881.220 rows=13,348,527 loops=1)

  • Filter: (estado_autorizacion_id = 4)
  • Rows Removed by Filter: 4684240
11. 7,655.148 7,655.148 ↑ 1.0 1 1,913,787

Index Scan using pk_solicitud_pkey on solicitud s (cost=0.43..0.59 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=1,913,787)

  • Index Cond: (id = si.solicitud_id)
12. 0.004 0.011 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=22) (actual time=0.011..0.011 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.007 0.007 ↑ 1.0 9 1

Seq Scan on tipo_valorizacion tv (cost=0.00..1.09 rows=9 width=22) (actual time=0.003..0.007 rows=9 loops=1)

14. 0.006 0.018 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=16) (actual time=0.018..0.018 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.012 0.012 ↑ 1.0 2 1

Seq Scan on regimen_afiliacion ra (cost=0.00..1.02 rows=2 width=16) (actual time=0.010..0.012 rows=2 loops=1)