explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gs33 : Optimization for: plan #rbZX

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.024 23.146 ↑ 1.0 1 1

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

2. 0.008 23.122 ↓ 4.0 4 1

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

3. 0.004 23.055 ↑ 1.0 1 1

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

4. 0.048 0.048 ↑ 1.0 1 1

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

  • Filter: (upper((facility_name)::text) = 'KK SEREMBAN'::text)
  • Rows Removed by Filter: 27
5. 7.265 23.003 ↑ 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=22.993..23.003 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. 15.738 15.738 ↓ 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=15.738..15.738 rows=4,672 loops=1)

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

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