explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pfrR

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 19.419 ↑ 1.0 1 1

Limit (cost=3,206.31..3,206.37 rows=1 width=214) (actual time=19.414..19.419 rows=1 loops=1)

2. 0.006 19.417 ↑ 1.0 1 1

Unique (cost=3,206.31..3,206.37 rows=1 width=214) (actual time=19.412..19.417 rows=1 loops=1)

3. 0.037 19.411 ↓ 4.0 4 1

Sort (cost=3,206.31..3,206.31 rows=1 width=214) (actual time=19.411..19.411 rows=4 loops=1)

  • Sort Key: prescripti0_.patient_order_id, prescripti0_.created_at, prescripti0_.created_by, prescripti0_.migrated_from, prescripti0_.is_read_only, prescripti0_.is_sync, prescripti0_.updated_at, prescripti0_.updated_by, prescripti0_.version_id, prescripti0_.assigned_hcp, prescripti0_.item_id, prescripti0_.created_date, prescripti0_.dispense_location, prescripti0_.dispense_location_name, prescripti0_.is_deleted, prescripti0_.last_modified_by, prescripti0_.last_modified_date, prescripti0_.ordering_location, prescripti0_.patient_id, prescripti0_.remarks, prescripti0_.status_id
  • Sort Method: quicksort Memory: 26kB
4. 0.004 19.374 ↓ 4.0 4 1

Nested Loop (cost=1,086.67..3,206.30 rows=1 width=214) (actual time=19.346..19.374 rows=4 loops=1)

5. 0.005 19.354 ↑ 1.0 1 1

Nested Loop (cost=1,086.25..3,201.72 rows=1 width=214) (actual time=19.330..19.354 rows=1 loops=1)

6. 0.039 0.039 ↑ 1.0 1 1

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

  • Filter: (upper((facility_name)::text) = 'KK SEREMBAN'::text)
  • Rows Removed by Filter: 27
7. 7.046 19.310 ↑ 1.0 1 1

Bitmap Heap Scan on mst_om_prescription_patient_order prescripti0_ (cost=1,086.25..3,200.29 rows=1 width=214) (actual time=19.302..19.310 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
8. 12.264 12.264 ↓ 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.264..12.264 rows=4,672 loops=1)

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

  • Index Cond: (patient_order_id = prescripti0_.patient_order_id)
  • Heap Fetches: 4
Planning time : 0.498 ms
Execution time : 19.495 ms