explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aBbB : Optimization for: Optimization for: Optimization for: plan #YZFI; plan #XFmI; plan #JPoy

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 27.099 422.203 ↓ 1.1 25,880 1

Hash Left Join (cost=3,989.17..60,173.50 rows=24,398 width=140) (actual time=168.989..422.203 rows=25,880 loops=1)

  • Hash Cond: (d.id_medico = me.id)
2. 19.837 388.005 ↓ 1.1 25,880 1

Hash Left Join (cost=3,661.12..59,781.38 rows=24,398 width=127) (actual time=161.866..388.005 rows=25,880 loops=1)

  • Hash Cond: (d.id_seccion = a.id)
3. 22.316 361.732 ↓ 1.1 25,880 1

Hash Left Join (cost=3,236.07..59,292.25 rows=24,398 width=109) (actual time=155.407..361.732 rows=25,880 loops=1)

  • Hash Cond: (d.id_seccion = se.id)
4. 25.109 332.144 ↓ 1.1 25,880 1

Hash Left Join (cost=2,835.71..58,827.82 rows=24,398 width=105) (actual time=148.110..332.144 rows=25,880 loops=1)

  • Hash Cond: (d.id_servicio = s.id)
5. 246.422 265.212 ↓ 1.1 25,880 1

Bitmap Heap Scan on dispensaciones_cache d (cost=915.51..56,843.58 rows=24,398 width=105) (actual time=106.202..265.212 rows=25,880 loops=1)

  • Recheck Cond: (id_medicamento = 26179)
  • Filter: ((administraciond_normalizada >= 20180101) AND (administraciond_normalizada <= 20181231) AND (id_hospital = 290))
  • Rows Removed by Filter: 25142
  • Heap Blocks: exact=33358
6. 18.790 18.790 ↓ 1.0 51,022 1

Bitmap Index Scan on dispensacion_medicamento (cost=0.00..909.41 rows=49,198 width=0) (actual time=18.790..18.790 rows=51,022 loops=1)

  • Index Cond: (id_medicamento = 26179)
7. 20.083 41.823 ↑ 1.0 55,342 1

Hash (cost=1,228.42..1,228.42 rows=55,342 width=8) (actual time=41.823..41.823 rows=55,342 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2674kB
8. 21.740 21.740 ↑ 1.0 55,342 1

Seq Scan on servicios s (cost=0.00..1,228.42 rows=55,342 width=8) (actual time=0.013..21.740 rows=55,342 loops=1)

9. 3.373 7.272 ↑ 1.0 12,194 1

Hash (cost=247.94..247.94 rows=12,194 width=8) (actual time=7.272..7.272 rows=12,194 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 605kB
10. 3.899 3.899 ↑ 1.0 12,194 1

Seq Scan on secciones se (cost=0.00..247.94 rows=12,194 width=8) (actual time=0.012..3.899 rows=12,194 loops=1)

11. 2.886 6.436 ↑ 1.0 9,380 1

Hash (cost=307.80..307.80 rows=9,380 width=26) (actual time=6.436..6.436 rows=9,380 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 680kB
12. 3.550 3.550 ↑ 1.0 9,380 1

Seq Scan on areas a (cost=0.00..307.80 rows=9,380 width=26) (actual time=0.009..3.550 rows=9,380 loops=1)

13. 3.239 7.099 ↑ 1.0 9,380 1

Hash (cost=210.80..210.80 rows=9,380 width=21) (actual time=7.098..7.099 rows=9,380 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 635kB
14. 3.860 3.860 ↑ 1.0 9,380 1

Seq Scan on medicos me (cost=0.00..210.80 rows=9,380 width=21) (actual time=0.013..3.860 rows=9,380 loops=1)

Planning time : 1.464 ms
Execution time : 425.341 ms