explain.depesz.com

PostgreSQL's explain analyze made readable

Result: M9gRc

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.005 0.036 ↓ 0.0 0 1

Sort (cost=2,053,825.37..2,053,829.02 rows=1,461 width=267) (actual time=0.036..0.036 rows=0 loops=1)

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

Nested Loop Left Join (cost=21,600.69..2,053,748.57 rows=1,461 width=267) (actual time=0.031..0.031 rows=0 loops=1)

3. 0.000 0.030 ↓ 0.0 0 1

Nested Loop Left Join (cost=21,600.40..2,053,237.16 rows=1,461 width=257) (actual time=0.030..0.030 rows=0 loops=1)

4. 0.001 0.030 ↓ 0.0 0 1

Nested Loop Left Join (cost=21,600.12..2,052,780.50 rows=1,461 width=239) (actual time=0.030..0.030 rows=0 loops=1)

5. 0.000 0.029 ↓ 0.0 0 1

Hash Left Join (cost=21,599.83..2,052,323.84 rows=1,461 width=229) (actual time=0.029..0.029 rows=0 loops=1)

  • Hash Cond: ((pr.admitted_dept)::text = (admdep.dept_id)::text)
6. 0.000 0.029 ↓ 0.0 0 1

Hash Left Join (cost=21,594.05..2,052,297.97 rows=1,461 width=219) (actual time=0.029..0.029 rows=0 loops=1)

  • Hash Cond: (pr.visit_type = vn.visit_type)
7. 0.000 0.029 ↓ 0.0 0 1

Hash Left Join (cost=21,592.96..2,052,276.80 rows=1,461 width=217) (actual time=0.029..0.029 rows=0 loops=1)

  • Hash Cond: ((pd.salutation)::text = (smb.salutation_id)::text)
8. 0.001 0.029 ↓ 0.0 0 1

Nested Loop (cost=21,590.70..2,052,254.45 rows=1,461 width=218) (actual time=0.029..0.029 rows=0 loops=1)

  • Join Filter: ((pr.center_id = bhcm.center_id) OR (isr.center_id = bhcm.center_id) OR (prc.center_id = bhcm.center_id))
9. 0.028 0.028 ↓ 0.0 0 1

Index Scan using center_name_idx on hospital_center_master bhcm (cost=0.27..2.49 rows=1 width=22) (actual time=0.028..0.028 rows=0 loops=1)

  • Index Cond: ((center_name)::text = 'CENTER RAJ'::text)
10. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=21,590.43..2,048,142.76 rows=234,811 width=212) (never executed)

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

Nested Loop (cost=21,586.00..2,044,909.68 rows=234,811 width=199) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=21,585.44..253,904.37 rows=76,413 width=151) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=21,585.01..216,722.38 rows=76,413 width=143) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=21,584.57..78,708.10 rows=76,413 width=112) (never executed)

  • Hash Cond: (b.dyna_package_id = dy.dyna_package_id)
15. 0.000 0.000 ↓ 0.0 0

Merge Left Join (cost=21,453.72..77,240.02 rows=76,413 width=82) (never executed)

  • Merge Cond: ((b.visit_id)::text = (isr.incoming_visit_id)::text)
16. 0.000 0.000 ↓ 0.0 0

Merge Left Join (cost=21,453.29..21,835.41 rows=76,413 width=60) (never executed)

  • Merge Cond: ((b.visit_id)::text = (prc.customer_id)::text)
17. 0.000 0.000 ↓ 0.0 0

Sort (cost=21,452.09..21,643.13 rows=76,413 width=46) (never executed)

  • Sort Key: b.visit_id
18. 0.000 0.000 ↓ 0.0 0

Index Scan using bill_finalized_date_idx on bill b (cost=0.44..15,254.41 rows=76,413 width=46) (never executed)

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

Sort (cost=1.20..1.22 rows=8 width=23) (never executed)

  • Sort Key: prc.customer_id
20. 0.000 0.000 ↓ 0.0 0

Seq Scan on store_retail_customers prc (cost=0.00..1.08 rows=8 width=23) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.43..51,874.66 rows=1,283,350 width=31) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Hash (cost=81.49..81.49 rows=3,949 width=38) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Seq Scan on dyna_packages dy (cost=0.00..81.49 rows=3,949 width=38) (never executed)

24. 0.000 0.000 ↓ 0.0 0

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

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

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

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

Index Scan using bill_charge_bill_no_index on bill_charge bc (cost=0.56..21.95 rows=149 width=61) (never executed)

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

Hash (cost=3.08..3.08 rows=108 width=25) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Seq Scan on chargehead_constants chc (cost=0.00..3.08 rows=108 width=25) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.56..1.56 rows=56 width=16) (never executed)

30. 0.000 0.000 ↓ 0.0 0

Seq Scan on salutation_master smb (cost=0.00..1.56 rows=56 width=16) (never executed)

31. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.04..1.04 rows=4 width=6) (never executed)

32. 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)

33. 0.000 0.000 ↓ 0.0 0

Hash (cost=3.68..3.68 rows=168 width=26) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Seq Scan on department admdep (cost=0.00..3.68 rows=168 width=26) (never executed)

35. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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