explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xCcAU : Optimization for: Optimization for: plan #M9gRc; plan #eJzX

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.006 0.018 ↓ 0.0 0 1

Sort (cost=194.25..194.26 rows=1 width=264) (actual time=0.018..0.018 rows=0 loops=1)

  • Sort Key: b.bill_no
  • Sort Method: quicksort Memory: 25kB
2. 0.001 0.012 ↓ 0.0 0 1

Nested Loop Left Join (cost=5.61..194.24 rows=1 width=264) (actual time=0.012..0.012 rows=0 loops=1)

3. 0.000 0.011 ↓ 0.0 0 1

Nested Loop Left Join (cost=5.32..193.09 rows=1 width=254) (actual time=0.011..0.011 rows=0 loops=1)

4. 0.000 0.011 ↓ 0.0 0 1

Nested Loop Left Join (cost=5.04..192.00 rows=1 width=236) (actual time=0.011..0.011 rows=0 loops=1)

5. 0.000 0.011 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.76..190.91 rows=1 width=226) (actual time=0.011..0.011 rows=0 loops=1)

6. 0.000 0.011 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.61..190.74 rows=1 width=216) (actual time=0.011..0.011 rows=0 loops=1)

  • Join Filter: (vn.visit_type = pr.visit_type)
7. 0.002 0.011 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.61..189.65 rows=1 width=214) (actual time=0.011..0.011 rows=0 loops=1)

8. 0.000 0.009 ↓ 0.0 0 1

Nested Loop (cost=4.47..189.48 rows=1 width=215) (actual time=0.009..0.009 rows=0 loops=1)

9. 0.000 0.009 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.72..177.59 rows=3 width=209) (actual time=0.009..0.009 rows=0 loops=1)

  • Join Filter: ((prc.customer_id)::text = (b.visit_id)::text)
10. 0.000 0.009 ↓ 0.0 0 1

Nested Loop (cost=2.72..175.21 rows=3 width=210) (actual time=0.009..0.009 rows=0 loops=1)

11. 0.000 0.009 ↓ 0.0 0 1

Nested Loop (cost=2.57..174.69 rows=3 width=197) (actual time=0.009..0.009 rows=0 loops=1)

12. 0.000 0.009 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.01..11.77 rows=1 width=148) (actual time=0.009..0.009 rows=0 loops=1)

13. 0.002 0.009 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.58..10.48 rows=1 width=140) (actual time=0.009..0.009 rows=0 loops=1)

14. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.15..7.83 rows=1 width=118) (actual time=0.007..0.007 rows=0 loops=1)

15. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.72..5.17 rows=1 width=75) (actual time=0.007..0.007 rows=0 loops=1)

16. 0.007 0.007 ↓ 0.0 0 1

Index Scan using bill_finalized_date_idx on bill b (cost=0.44..2.66 rows=1 width=45) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date(finalized_date) >= '2020-08-01'::date) AND (date(finalized_date) <= '2020-08-31'::date))
  • Filter: (status <> 'X'::bpchar)
17. 0.000 0.000 ↓ 0.0 0

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

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

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.43..2.65 rows=1 width=55) (never executed)

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

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.43..2.65 rows=1 width=31) (never executed)

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

Index Scan using patient_details_pkey on patient_details pd (cost=0.43..1.28 rows=1 width=38) (never executed)

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

Index Scan using bill_charge_bill_no_index on bill_charge bc (cost=0.56..161.53 rows=139 width=62) (never executed)

  • Index Cond: ((bill_no)::text = (b.bill_no)::text)
  • Filter: (status <> 'X'::bpchar)
22. 0.000 0.000 ↓ 0.0 0

Index Scan using chargehead_constants_pkey on chargehead_constants chc (cost=0.14..0.16 rows=1 width=25) (never executed)

  • Index Cond: ((chargehead_id)::text = (bc.charge_head)::text)
23. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.36 rows=24 width=20) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Seq Scan on store_retail_customers prc (cost=0.00..1.24 rows=24 width=20) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on hospital_center_master bhcm (cost=1.76..3.95 rows=1 width=22) (never executed)

  • Recheck Cond: ((pr.center_id = center_id) OR (isr.center_id = center_id) OR (prc.center_id = center_id))
  • Filter: ((center_name)::text = 'Sugar Chattisgarh'::text)
26. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=1.76..1.76 rows=3 width=0) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on center_pkey (cost=0.00..0.56 rows=1 width=0) (never executed)

  • Index Cond: (pr.center_id = center_id)
28. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on center_pkey (cost=0.00..0.56 rows=1 width=0) (never executed)

  • Index Cond: (isr.center_id = center_id)
29. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on center_pkey (cost=0.00..0.65 rows=1 width=0) (never executed)

  • Index Cond: (prc.center_id = center_id)
30. 0.000 0.000 ↓ 0.0 0

Index Scan using salutation_master_pkey on salutation_master smb (cost=0.14..0.16 rows=1 width=16) (never executed)

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

Seq Scan on visit_type_names vn (cost=0.00..1.04 rows=4 width=6) (never executed)

32. 0.000 0.000 ↓ 0.0 0

Index Scan using department_pkey on department admdep (cost=0.14..0.16 rows=1 width=26) (never executed)

  • Index Cond: ((pr.admitted_dept)::text = (dept_id)::text)
33. 0.000 0.000 ↓ 0.0 0

Index Scan using doctors_pkey on doctors dr (cost=0.28..1.08 rows=1 width=26) (never executed)

  • Index Cond: ((doctor_id)::text = (pr.doctor)::text)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using doctors_pkey on doctors rdoc (cost=0.28..1.08 rows=1 width=26) (never executed)

  • Index Cond: ((pr.reference_docto_id)::text = (doctor_id)::text)
35. 0.000 0.000 ↓ 0.0 0

Index Scan using referral_pkey on referral ref (cost=0.29..1.11 rows=1 width=21) (never executed)

  • Index Cond: ((pr.reference_docto_id)::text = (referal_no)::text)
Total runtime : 0.424 ms