explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dZgy

Settings
# exclusive inclusive rows x rows loops node
1. 0.033 0.133 ↓ 0.0 0 1

Sort (cost=77,218.37..77,218.37 rows=1 width=213) (actual time=0.133..0.133 rows=0 loops=1)

  • Sort Key: (date(b.finalized_date))
  • Sort Method: quicksort Memory: 25kB
2. 0.000 0.100 ↓ 0.0 0 1

Nested Loop Left Join (cost=687.23..77,218.36 rows=1 width=213) (actual time=0.100..0.100 rows=0 loops=1)

  • Join Filter: ((hcmo.center_id)::text = (dom.outsource_dest)::text)
  • Filter: (CASE WHEN ((dom.outsource_dest_type)::text = ANY ('{O,IO}'::text[])) THEN om.oh_name ELSE hcmo.center_name END IS NULL)
3. 0.000 0.100 ↓ 0.0 0 1

Nested Loop Left Join (cost=687.23..77,217.28 rows=1 width=209) (actual time=0.100..0.100 rows=0 loops=1)

  • Join Filter: ((om.oh_id)::text = (dom.outsource_dest)::text)
4. 0.000 0.100 ↓ 0.0 0 1

Nested Loop Left Join (cost=687.23..77,216.10 rows=1 width=199) (actual time=0.100..0.100 rows=0 loops=1)

  • Join Filter: ((dom.outsource_dest_id = tp.outsource_dest_id) OR (dom.outsource_dest_id = tpr.outsource_dest_id))
5. 0.000 0.100 ↓ 0.0 0 1

Nested Loop Left Join (cost=687.23..77,214.90 rows=1 width=194) (actual time=0.100..0.100 rows=0 loops=1)

  • Join Filter: ((tpr.pat_id)::text = (isr.incoming_visit_id)::text)
6. 0.000 0.100 ↓ 0.0 0 1

Nested Loop Left Join (cost=686.80..77,137.54 rows=1 width=206) (actual time=0.100..0.100 rows=0 loops=1)

7. 0.000 0.100 ↓ 0.0 0 1

Nested Loop Left Join (cost=686.38..77,136.83 rows=1 width=206) (actual time=0.100..0.100 rows=0 loops=1)

  • Join Filter: ((pm.package_id)::text = (bc.act_description_id)::text)
  • Filter: (((bc.charge_group)::text = 'DIA'::text) OR (((bc.charge_group)::text = 'PKG'::text) AND (pm.package_type = 'd'::bpchar)))
8. 0.000 0.100 ↓ 0.0 0 1

Nested Loop Left Join (cost=686.38..77,117.02 rows=1 width=210) (actual time=0.100..0.100 rows=0 loops=1)

9. 0.000 0.100 ↓ 0.0 0 1

Nested Loop Left Join (cost=686.23..77,116.85 rows=1 width=207) (actual time=0.100..0.100 rows=0 loops=1)

10. 0.001 0.100 ↓ 0.0 0 1

Nested Loop Left Join (cost=686.10..77,116.69 rows=1 width=212) (actual time=0.100..0.100 rows=0 loops=1)

11. 0.000 0.099 ↓ 0.0 0 1

Nested Loop Left Join (cost=685.68..77,116.17 rows=1 width=196) (actual time=0.099..0.099 rows=0 loops=1)

12. 0.001 0.099 ↓ 0.0 0 1

Nested Loop Left Join (cost=685.41..77,107.87 rows=1 width=182) (actual time=0.099..0.099 rows=0 loops=1)

13. 0.000 0.098 ↓ 0.0 0 1

Nested Loop Left Join (cost=685.12..77,099.56 rows=1 width=172) (actual time=0.098..0.098 rows=0 loops=1)

14. 0.000 0.098 ↓ 0.0 0 1

Nested Loop Left Join (cost=684.69..77,091.10 rows=1 width=155) (actual time=0.098..0.098 rows=0 loops=1)

15. 0.000 0.098 ↓ 0.0 0 1

Nested Loop (cost=684.42..77,082.80 rows=1 width=125) (actual time=0.098..0.098 rows=0 loops=1)

16. 0.009 0.098 ↓ 0.0 0 1

Hash Join (cost=683.99..76,956.15 rows=224 width=92) (actual time=0.098..0.098 rows=0 loops=1)

  • Hash Cond: ((bc.charge_head)::text = (chc.chargehead_id)::text)
17. 0.000 0.070 ↓ 0.0 0 1

Nested Loop (cost=682.22..76,900.89 rows=13,666 width=82) (actual time=0.070..0.070 rows=0 loops=1)

18. 0.070 0.070 ↓ 0.0 0 1

Seq Scan on doctors predoc (cost=0.00..16.70 rows=1 width=23) (actual time=0.070..0.070 rows=0 loops=1)

  • Filter: ((doctor_name)::text = 'DOC0021'::text)
  • Rows Removed by Filter: 216
19. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on bill_charge bc (cost=682.22..76,653.58 rows=23,061 width=74) (never executed)

  • Recheck Cond: ((prescribing_dr_id)::text = (predoc.doctor_id)::text)
  • Filter: (status <> 'X'::bpchar)
20. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on bc_pres_doc_index (cost=0.00..676.45 rows=25,069 width=0) (never executed)

  • Index Cond: ((prescribing_dr_id)::text = (predoc.doctor_id)::text)
21. 0.002 0.019 ↑ 1.0 1 1

Hash (cost=1.76..1.76 rows=1 width=22) (actual time=0.019..0.019 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
22. 0.017 0.017 ↑ 1.0 1 1

Seq Scan on chargehead_constants chc (cost=0.00..1.76 rows=1 width=22) (actual time=0.014..0.017 rows=1 loops=1)

  • Filter: ((chargehead_name)::text = 'Laboratory Test'::text)
  • Rows Removed by Filter: 60
23. 0.000 0.000 ↓ 0.0 0

Index Scan using bill_pkey on bill b (cost=0.42..0.56 rows=1 width=42) (never executed)

  • Index Cond: ((bill_no)::text = (bc.bill_no)::text)
  • Filter: ((status <> 'X'::bpchar) AND (date(closed_date) >= '2018-11-01'::date) AND (date(closed_date) <= '2018-11-30'::date) AND (CASE WHEN (payment_status = 'P'::bpchar) THEN 'Paid'::text ELSE 'Unpaid'::text END = 'P'::text) AND (CASE WHEN (status = 'A'::bpchar) THEN 'Open'::text WHEN (status = 'F'::bpchar) THEN 'Finalized'::text WHEN (status = 'C'::bpchar) THEN 'Closed'::text ELSE 'Cancelled'::text END = 'C'::text))
24. 0.000 0.000 ↓ 0.0 0

Index Scan using dyna_packages_pkey on dyna_packages dy (cost=0.28..8.29 rows=1 width=38) (never executed)

  • Index Cond: (dyna_package_id = b.dyna_package_id)
25. 0.000 0.000 ↓ 0.0 0

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.42..8.44 rows=1 width=26) (never executed)

  • Index Cond: ((patient_id)::text = (b.visit_id)::text)
26. 0.000 0.000 ↓ 0.0 0

Index Scan using pharmacy_retail_customers_pkey on store_retail_customers prc (cost=0.29..8.31 rows=1 width=19) (never executed)

  • Index Cond: ((customer_id)::text = (b.visit_id)::text)
27. 0.000 0.000 ↓ 0.0 0

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: ((incoming_visit_id)::text = (b.visit_id)::text)
28. 0.000 0.000 ↓ 0.0 0

Index Scan using patient_details_pkey on patient_details pd (cost=0.42..0.50 rows=1 width=34) (never executed)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using salutation_master_pkey on salutation_master smb (cost=0.13..0.15 rows=1 width=13) (never executed)

  • Index Cond: ((salutation_id)::text = (pd.salutation)::text)
30. 0.000 0.000 ↓ 0.0 0

Index Scan using organization_details_pkey on organization_details od (cost=0.14..0.16 rows=1 width=19) (never executed)

  • Index Cond: ((pr.org_id)::text = (org_id)::text)
31. 0.000 0.000 ↓ 0.0 0

Seq Scan on pack_master pm (cost=0.00..10.66 rows=366 width=6) (never executed)

32. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_test_presc_common_order_id on tests_prescribed tp (cost=0.43..0.70 rows=1 width=16) (never executed)

  • Index Cond: (common_order_id = bc.order_number)
  • Filter: ((test_id)::text = (bc.act_description_id)::text)
33. 0.000 0.000 ↓ 0.0 0

Index Scan using tests_prescribed_testid_idx on tests_prescribed tpr (cost=0.43..45.33 rows=2,563 width=21) (never executed)

  • Index Cond: ((test_id)::text = (bc.act_description_id)::text)
34. 0.000 0.000 ↓ 0.0 0

Seq Scan on diag_outsource_master dom (cost=0.00..1.08 rows=8 width=17) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Seq Scan on outhouse_master om (cost=0.00..1.08 rows=8 width=21) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Seq Scan on hospital_center_master hcmo (cost=0.00..1.01 rows=1 width=19) (never executed)