explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rbZX

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.037 178.987 ↑ 1.0 1 1

Aggregate (cost=31,034.39..31,034.40 rows=1 width=8) (actual time=178.987..178.987 rows=1 loops=1)

2. 0.028 178.950 ↓ 4.0 4 1

Nested Loop (cost=0.43..31,034.38 rows=1 width=8) (actual time=173.824..178.950 rows=4 loops=1)

3. 0.034 178.853 ↑ 1.0 1 1

Nested Loop (cost=0.00..31,029.81 rows=1 width=8) (actual time=173.739..178.853 rows=1 loops=1)

  • Join Filter: (prescripti0_.ordering_location = healthfaci2_.facility_id)
  • Rows Removed by Join Filter: 8
4. 178.603 178.603 ↓ 9.0 9 1

Seq Scan on mst_om_prescription_patient_order prescripti0_ (cost=0.00..31,028.38 rows=1 width=12) (actual time=173.661..178.603 rows=9 loops=1)

  • 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) AND ((approval_status)::text = 'For Approval'::text))
  • Rows Removed by Filter: 735156
5. 0.216 0.216 ↑ 1.0 1 9

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

  • Filter: (upper((facility_name)::text) = 'KK SEREMBAN'::text)
  • Rows Removed by Filter: 27
6. 0.069 0.069 ↑ 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.057..0.069 rows=4 loops=1)

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