explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9OUb : Optimization for: Optimization for: plan #1Grl; plan #Kp3J

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.041 194.812 ↑ 1.0 1 1

Aggregate (cost=27,548.17..27,548.18 rows=1 width=0) (actual time=194.812..194.812 rows=1 loops=1)

2. 0.274 194.771 ↑ 1.7 638 1

Hash Join (cost=4,319.09..27,545.43 rows=1,096 width=0) (actual time=192.264..194.771 rows=638 loops=1)

  • Hash Cond: (ppo.dispense_location = fa.facility_id)
3. 169.129 194.481 ↑ 1.7 638 1

Bitmap Heap Scan on mst_om_prescription_patient_order ppo (cost=4,317.46..27,528.73 rows=1,097 width=4) (actual time=192.228..194.481 rows=638 loops=1)

  • Recheck Cond: (ordering_location = 4)
  • Filter: (date(created_at) = ('now'::cstring)::date)
  • Rows Removed by Filter: 217969
  • Heap Blocks: exact=18225
4. 25.352 25.352 ↑ 1.0 218,756 1

Bitmap Index Scan on mst_om_prescription_patient_order_ordering_location_idx (cost=0.00..4,317.18 rows=219,301 width=0) (actual time=25.352..25.352 rows=218,756 loops=1)

  • Index Cond: (ordering_location = 4)
5. 0.004 0.016 ↑ 1.0 28 1

Hash (cost=1.28..1.28 rows=28 width=4) (actual time=0.016..0.016 rows=28 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
6. 0.012 0.012 ↑ 1.0 28 1

Seq Scan on mst_am_facility fa (cost=0.00..1.28 rows=28 width=4) (actual time=0.002..0.012 rows=28 loops=1)

Planning time : 0.448 ms
Execution time : 194.888 ms