explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.025 19.706 ↑ 1.0 1 1

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

2. 0.008 19.681 ↓ 4.0 4 1

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

3. 0.005 19.606 ↑ 1.0 1 1

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

4. 0.046 0.046 ↑ 1.0 1 1

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

  • Filter: (upper((facility_name)::text) = 'KK SEREMBAN'::text)
  • Rows Removed by Filter: 27
5. 7.175 19.555 ↑ 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.545..19.555 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.380 12.380 ↓ 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.380..12.380 rows=4,672 loops=1)

  • Index Cond: ((ordering_location = healthfaci2_.facility_id) AND ((approval_status)::text = 'For Approval'::text))
7. 0.067 0.067 ↑ 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.055..0.067 rows=4 loops=1)

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