explain.depesz.com

PostgreSQL's explain analyze made readable

Result: P8Y : Optimization for: Optimization for: Optimization for: plan #rbZX; plan #gs33; plan #atZy

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.020 19.846 ↑ 1.0 1 1

Aggregate (cost=3,206.30..3,206.31 rows=1 width=8) (actual time=19.845..19.846 rows=1 loops=1)

2. 0.006 19.826 ↓ 4.0 4 1

Nested Loop (cost=1,086.67..3,206.30 rows=1 width=8) (actual time=19.784..19.826 rows=4 loops=1)

3. 0.004 19.756 ↑ 1.0 1 1

Nested Loop (cost=1,086.25..3,201.72 rows=1 width=8) (actual time=19.725..19.756 rows=1 loops=1)

4. 0.045 0.045 ↑ 1.0 1 1

Seq Scan on mst_am_facility healthfaci2_ (cost=0.00..1.42 rows=1 width=4) (actual time=0.024..0.045 rows=1 loops=1)

  • Filter: (upper((facility_name)::text) = 'KK SEREMBAN'::text)
  • Rows Removed by Filter: 27
5. 7.360 19.707 ↑ 1.0 1 1

Bitmap Heap Scan on mst_om_prescription_patient_order prescripti0_ (cost=1,086.25..3,200.29 rows=1 width=12) (actual time=19.697..19.707 rows=1 loops=1)

  • Recheck Cond: ((ordering_location = healthfaci2_.facility_id) AND ((approval_status)::text = 'For Approval'::text))
  • Filter: ((created_date >= '2019-04-09 00:00:00'::timestamp without time zone) AND (created_date <= '2019-04-11 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 4671
  • Heap Blocks: exact=3392
6. 12.347 12.347 ↓ 3.8 4,672 1

Bitmap Index Scan on mst_om_prescription_patient_order_ordering_location_idx (cost=0.00..1,086.24 rows=1,238 width=0) (actual time=12.347..12.347 rows=4,672 loops=1)

  • Index Cond: ((ordering_location = healthfaci2_.facility_id) AND ((approval_status)::text = 'For Approval'::text))
7. 0.064 0.064 ↑ 1.2 4 1

Index Only Scan using mst_om_prescription_order_patient_order_id_idx on mst_om_prescription_order listprescr1_ (cost=0.43..4.53 rows=5 width=8) (actual time=0.054..0.064 rows=4 loops=1)

  • Index Cond: (patient_order_id = prescripti0_.patient_order_id)
  • Heap Fetches: 4