explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 02J : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #Dr7b; plan #Cuqw; plan #iBhy; plan #Og9h; plan #O2ZQ; plan #Ms2E; plan #Y0LC; plan #FWxt

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 2,046.322 ↑ 699.9 16 1

Append (cost=231,339.42..346,683.61 rows=11,198 width=3,015) (actual time=2,037.971..2,046.322 rows=16 loops=1)

2. 0.085 2,040.983 ↑ 861.2 13 1

Hash Left Join (cost=231,339.42..345,306.57 rows=11,195 width=3,015) (actual time=2,037.971..2,040.983 rows=13 loops=1)

  • Hash Cond: (pr.patient_category_id = prcm.category_id)
3. 0.027 2,040.860 ↑ 861.2 13 1

Nested Loop Left Join (cost=231,333.25..344,138.92 rows=11,195 width=3,001) (actual time=2,037.900..2,040.860 rows=13 loops=1)

4. 0.011 2,040.625 ↑ 861.2 13 1

Hash Left Join (cost=231,325.44..330,095.38 rows=11,195 width=2,862) (actual time=2,037.869..2,040.625 rows=13 loops=1)

  • Hash Cond: ((b.visit_id)::text = (isr.incoming_visit_id)::text)
5. 0.005 2,040.608 ↑ 861.2 13 1

Hash Left Join (cost=231,324.06..330,052.01 rows=11,195 width=2,298) (actual time=2,037.858..2,040.608 rows=13 loops=1)

  • Hash Cond: ((pr.secondary_sponsor_id)::text = (stm.tpa_id)::text)
6. 0.016 2,040.515 ↑ 861.2 13 1

Hash Left Join (cost=231,307.89..329,993.83 rows=11,195 width=2,287) (actual time=2,037.766..2,040.515 rows=13 loops=1)

  • Hash Cond: ((pr.primary_sponsor_id)::text = (ptm.tpa_id)::text)
7. 0.009 2,040.399 ↑ 861.2 13 1

Hash Left Join (cost=231,291.73..329,826.53 rows=11,195 width=2,275) (actual time=2,037.661..2,040.399 rows=13 loops=1)

  • Hash Cond: ((bc.act_department_id)::text = tdep.dept_id)
8. 0.016 2,040.326 ↑ 861.2 13 1

Hash Left Join (cost=231,284.38..329,696.39 rows=11,195 width=2,250) (actual time=2,037.590..2,040.326 rows=13 loops=1)

  • Hash Cond: (bc.account_group = bcagm.account_group_id)
9. 8.824 2,040.303 ↑ 861.2 13 1

Hash Left Join (cost=231,283.29..329,541.37 rows=11,195 width=1,836) (actual time=2,037.572..2,040.303 rows=13 loops=1)

  • Hash Cond: ((b.visit_id)::text = (pr.patient_id)::text)
10. 1.183 1,591.750 ↑ 861.2 13 1

Hash Left Join (cost=194,135.49..282,616.67 rows=11,195 width=1,803) (actual time=1,566.914..1,591.750 rows=13 loops=1)

  • Hash Cond: ((b.visit_id)::text = (prc.customer_id)::text)
11. 0.017 1,571.269 ↑ 861.2 13 1

Hash Left Join (cost=192,507.61..275,721.23 rows=11,195 width=1,790) (actual time=1,527.135..1,571.269 rows=13 loops=1)

  • Hash Cond: (rpt.currency_id = fc.currency_id)
12. 0.011 1,571.252 ↑ 861.2 13 1

Hash Left Join (cost=192,494.91..275,563.12 rows=11,195 width=1,278) (actual time=1,527.130..1,571.252 rows=13 loops=1)

  • Hash Cond: (rpt.card_type_id = ctm.card_type_id)
13. 0.018 1,571.238 ↑ 861.2 13 1

Hash Left Join (cost=192,493.85..275,408.13 rows=11,195 width=1,164) (actual time=1,527.122..1,571.238 rows=13 loops=1)

  • Hash Cond: (bc.service_sub_group_id = ssg.service_sub_group_id)
14. 0.018 1,570.801 ↑ 861.2 13 1

Hash Left Join (cost=192,446.69..275,207.04 rows=11,195 width=935) (actual time=1,526.697..1,570.801 rows=13 loops=1)

  • Hash Cond: ((bc.charge_head)::text = (chc.chargehead_id)::text)
15. 0.031 1,570.701 ↑ 861.2 13 1

Hash Left Join (cost=192,439.72..275,046.14 rows=11,195 width=689) (actual time=1,526.610..1,570.701 rows=13 loops=1)

  • Hash Cond: (((bc.charge_id)::text = (bcra.charge_id)::text) AND (r.bill_receipt_id = bcra.bill_receipt_id))
16. 0.015 1,570.658 ↑ 861.2 13 1

Hash Join (cost=192,421.47..274,048.31 rows=11,195 width=671) (actual time=1,526.584..1,570.658 rows=13 loops=1)

  • Hash Cond: (rpt.payment_mode_id = pm.mode_id)
17. 0.021 1,570.635 ↑ 861.2 13 1

Hash Join (cost=192,420.22..273,893.13 rows=11,195 width=597) (actual time=1,526.570..1,570.635 rows=13 loops=1)

  • Hash Cond: (b.visit_type = vtn.visit_type)
18. 0.019 1,570.611 ↑ 861.2 13 1

Hash Join (cost=192,419.13..273,738.11 rows=11,195 width=567) (actual time=1,526.562..1,570.611 rows=13 loops=1)

  • Hash Cond: ((rpt.counter)::text = (c.counter_id)::text)
19. 287.132 1,570.587 ↑ 861.2 13 1

Hash Join (cost=192,417.90..273,582.96 rows=11,195 width=341) (actual time=1,526.551..1,570.587 rows=13 loops=1)

  • Hash Cond: ((b.bill_no)::text = (r.bill_no)::text)
20. 395.574 395.574 ↑ 1.0 1,080,041 1

Seq Scan on bill b (cost=0.00..51,407.63 rows=1,080,063 width=55) (actual time=0.031..395.574 rows=1,080,041 loops=1)

21. 0.075 887.881 ↑ 861.2 13 1

Hash (cost=191,828.97..191,828.97 rows=11,195 width=302) (actual time=887.881..887.881 rows=13 loops=1)

  • Buckets: 1,024 Batches: 4 Memory Usage: 2kB
22. 177.328 887.806 ↑ 861.2 13 1

Hash Join (cost=57,925.94..191,828.97 rows=11,195 width=302) (actual time=887.795..887.806 rows=13 loops=1)

  • Hash Cond: ((bc.bill_no)::text = (r.bill_no)::text)
23. 310.406 310.406 ↑ 1.0 2,239,924 1

Seq Scan on bill_charge bc (cost=0.00..125,391.33 rows=2,239,933 width=79) (actual time=0.004..310.406 rows=2,239,924 loops=1)

24. 0.005 400.072 ↑ 763.2 5 1

Hash (cost=57,878.24..57,878.24 rows=3,816 width=223) (actual time=400.072..400.072 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
25. 55.580 400.067 ↑ 763.2 5 1

Hash Join (cost=31,382.57..57,878.24 rows=3,816 width=223) (actual time=400.061..400.067 rows=5 loops=1)

  • Hash Cond: ((r.receipt_no)::text = (rpt.receipt_id)::text)
26. 63.483 63.483 ↓ 1.0 772,550 1

Seq Scan on bill_receipts r (cost=0.00..20,663.86 rows=772,486 width=31) (actual time=0.006..63.483 rows=772,550 loops=1)

27. 0.006 281.004 ↑ 763.4 5 1

Hash (cost=31,334.86..31,334.86 rows=3,817 width=201) (actual time=281.004..281.004 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
28. 280.998 280.998 ↑ 763.4 5 1

Seq Scan on receipts rpt (cost=0.00..31,334.86 rows=3,817 width=201) (actual time=280.994..280.998 rows=5 loops=1)

  • Filter: ((NOT is_deposit) AND (amount > 0::numeric) AND (payment_mode_id <> (-9)) AND (date(display_date) = '2020-08-03'::date))
  • Rows Removed by Filter: 772,645
29. 0.003 0.005 ↑ 1.0 10 1

Hash (cost=1.10..1.10 rows=10 width=292) (actual time=0.005..0.005 rows=10 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
30. 0.002 0.002 ↑ 1.0 10 1

Seq Scan on counters c (cost=0.00..1.10 rows=10 width=292) (actual time=0.001..0.002 rows=10 loops=1)

31. 0.001 0.003 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=40) (actual time=0.003..0.003 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
32. 0.002 0.002 ↑ 1.0 4 1

Seq Scan on visit_type_names vtn (cost=0.00..1.04 rows=4 width=40) (actual time=0.001..0.002 rows=4 loops=1)

33. 0.003 0.008 ↓ 1.4 15 1

Hash (cost=1.11..1.11 rows=11 width=82) (actual time=0.008..0.008 rows=15 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
34. 0.005 0.005 ↓ 1.4 15 1

Seq Scan on payment_mode_master pm (cost=0.00..1.11 rows=11 width=82) (actual time=0.003..0.005 rows=15 loops=1)

35. 0.004 0.012 ↑ 36.7 9 1

Hash (cost=13.30..13.30 rows=330 width=82) (actual time=0.012..0.012 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
36. 0.008 0.008 ↑ 36.7 9 1

Seq Scan on bill_charge_receipt_allocation bcra (cost=0.00..13.30 rows=330 width=82) (actual time=0.004..0.008 rows=9 loops=1)

37. 0.011 0.082 ↑ 1.0 62 1

Hash (cost=6.20..6.20 rows=62 width=258) (actual time=0.082..0.082 rows=62 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 6kB
38. 0.021 0.071 ↑ 1.0 62 1

Hash Left Join (cost=2.88..6.20 rows=62 width=258) (actual time=0.030..0.071 rows=62 loops=1)

  • Hash Cond: (chc.account_head_id = bahc.account_head_id)
39. 0.024 0.041 ↑ 1.0 62 1

Hash Left Join (cost=1.41..3.88 rows=62 width=144) (actual time=0.016..0.041 rows=62 loops=1)

  • Hash Cond: ((chc.chargegroup_id)::text = (cgc.chargegroup_id)::text)
40. 0.009 0.009 ↑ 1.0 62 1

Seq Scan on chargehead_constants chc (cost=0.00..1.62 rows=62 width=30) (actual time=0.004..0.009 rows=62 loops=1)

41. 0.003 0.008 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=156) (actual time=0.008..0.008 rows=18 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
42. 0.005 0.005 ↑ 1.0 18 1

Seq Scan on chargegroup_constants cgc (cost=0.00..1.18 rows=18 width=156) (actual time=0.002..0.005 rows=18 loops=1)

43. 0.003 0.009 ↑ 1.0 21 1

Hash (cost=1.21..1.21 rows=21 width=122) (actual time=0.009..0.009 rows=21 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 2kB
44. 0.006 0.006 ↑ 1.0 21 1

Seq Scan on bill_account_heads bahc (cost=0.00..1.21 rows=21 width=122) (actual time=0.002..0.006 rows=21 loops=1)

45. 0.143 0.419 ↑ 1.0 921 1

Hash (cost=35.64..35.64 rows=921 width=237) (actual time=0.419..0.419 rows=921 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 60kB
46. 0.184 0.276 ↑ 1.0 921 1

Hash Left Join (cost=1.77..35.64 rows=921 width=237) (actual time=0.018..0.276 rows=921 loops=1)

  • Hash Cond: (ssg.service_group_id = sg.service_group_id)
47. 0.080 0.080 ↑ 1.0 921 1

Seq Scan on service_sub_groups ssg (cost=0.00..21.21 rows=921 width=23) (actual time=0.002..0.080 rows=921 loops=1)

48. 0.005 0.012 ↑ 1.0 34 1

Hash (cost=1.34..1.34 rows=34 width=222) (actual time=0.012..0.012 rows=34 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 2kB
49. 0.007 0.007 ↑ 1.0 34 1

Seq Scan on service_groups sg (cost=0.00..1.34 rows=34 width=222) (actual time=0.001..0.007 rows=34 loops=1)

50. 0.001 0.003 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=122) (actual time=0.003..0.003 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
51. 0.002 0.002 ↑ 1.0 3 1

Seq Scan on card_type_master ctm (cost=0.00..1.03 rows=3 width=122) (actual time=0.002..0.002 rows=3 loops=1)

52. 0.000 0.000 ↓ 0.0 0 1

Hash (cost=11.20..11.20 rows=120 width=520) (actual time=0.000..0.000 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 0kB
53. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on foreign_currency fc (cost=0.00..11.20 rows=120 width=520) (actual time=0.000..0.000 rows=0 loops=1)

54. 14.068 19.298 ↑ 1.0 45,328 1

Hash (cost=839.28..839.28 rows=45,328 width=13) (actual time=19.298..19.298 rows=45,328 loops=1)

  • Buckets: 4,096 Batches: 4 Memory Usage: 508kB
55. 5.230 5.230 ↑ 1.0 45,328 1

Seq Scan on store_retail_customers prc (cost=0.00..839.28 rows=45,328 width=13) (actual time=0.004..5.230 rows=45,328 loops=1)

56. 170.912 439.729 ↓ 1.0 520,305 1

Hash (cost=26,071.02..26,071.02 rows=520,302 width=42) (actual time=439.729..439.729 rows=520,305 loops=1)

  • Buckets: 2,048 Batches: 64 Memory Usage: 548kB
57. 268.817 268.817 ↓ 1.0 520,305 1

Seq Scan on patient_registration pr (cost=0.00..26,071.02 rows=520,302 width=42) (actual time=0.007..268.817 rows=520,305 loops=1)

58. 0.001 0.007 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=422) (actual time=0.007..0.007 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
59. 0.006 0.006 ↑ 1.0 4 1

Seq Scan on account_group_master bcagm (cost=0.00..1.04 rows=4 width=422) (actual time=0.005..0.006 rows=4 loops=1)

60. 0.013 0.064 ↑ 1.0 100 1

Hash (cost=6.10..6.10 rows=100 width=64) (actual time=0.064..0.064 rows=100 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 6kB
61. 0.010 0.051 ↑ 1.0 100 1

Subquery Scan on tdep (cost=0.00..6.10 rows=100 width=64) (actual time=0.005..0.051 rows=100 loops=1)

62. 0.007 0.041 ↑ 1.0 100 1

Append (cost=0.00..5.10 rows=100 width=123) (actual time=0.004..0.041 rows=100 loops=1)

63. 0.006 0.006 ↑ 1.0 7 1

Seq Scan on services_departments (cost=0.00..1.10 rows=7 width=162) (actual time=0.004..0.006 rows=7 loops=1)

64. 0.001 0.011 ↑ 1.0 25 1

Subquery Scan on "*SELECT* 2_1" (cost=0.00..1.56 rows=25 width=394) (actual time=0.004..0.011 rows=25 loops=1)

65. 0.010 0.010 ↑ 1.0 25 1

Seq Scan on diagnostics_departments (cost=0.00..1.31 rows=25 width=394) (actual time=0.004..0.010 rows=25 loops=1)

66. 0.008 0.017 ↑ 1.0 68 1

Subquery Scan on "*SELECT* 3" (cost=0.00..2.36 rows=68 width=20) (actual time=0.004..0.017 rows=68 loops=1)

67. 0.009 0.009 ↑ 1.0 68 1

Seq Scan on department (cost=0.00..1.68 rows=68 width=20) (actual time=0.003..0.009 rows=68 loops=1)

68. 0.044 0.100 ↑ 1.0 363 1

Hash (cost=11.63..11.63 rows=363 width=31) (actual time=0.100..0.100 rows=363 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 23kB
69. 0.056 0.056 ↑ 1.0 363 1

Seq Scan on tpa_master ptm (cost=0.00..11.63 rows=363 width=31) (actual time=0.003..0.056 rows=363 loops=1)

70. 0.050 0.088 ↑ 1.0 363 1

Hash (cost=11.63..11.63 rows=363 width=31) (actual time=0.088..0.088 rows=363 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 23kB
71. 0.038 0.038 ↑ 1.0 363 1

Seq Scan on tpa_master stm (cost=0.00..11.63 rows=363 width=31) (actual time=0.001..0.038 rows=363 loops=1)

72. 0.005 0.006 ↑ 1.0 17 1

Hash (cost=1.17..1.17 rows=17 width=564) (actual time=0.006..0.006 rows=17 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
73. 0.001 0.001 ↑ 1.0 17 1

Seq Scan on incoming_sample_registration isr (cost=0.00..1.17 rows=17 width=564) (actual time=0.001..0.001 rows=17 loops=1)

74. 0.065 0.208 ↑ 1.0 1 13

Hash Right Join (cost=7.81..9.05 rows=1 width=149) (actual time=0.012..0.016 rows=1 loops=13)

  • Hash Cond: ((smb.salutation_id)::text = (pd.salutation)::text)
75. 0.026 0.026 ↑ 1.0 17 13

Seq Scan on salutation_master smb (cost=0.00..1.17 rows=17 width=156) (actual time=0.000..0.002 rows=17 loops=13)

76. 0.013 0.117 ↑ 1.0 1 13

Hash (cost=7.79..7.79 rows=1 width=40) (actual time=0.009..0.009 rows=1 loops=13)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
77. 0.104 0.104 ↑ 1.0 1 13

Index Scan using patient_details_pkey on patient_details pd (cost=0.42..7.79 rows=1 width=40) (actual time=0.008..0.008 rows=1 loops=13)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
78. 0.017 0.038 ↑ 1.0 141 1

Hash (cost=4.41..4.41 rows=141 width=22) (actual time=0.038..0.038 rows=141 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
79. 0.021 0.021 ↑ 1.0 141 1

Seq Scan on patient_category_master prcm (cost=0.00..4.41 rows=141 width=22) (actual time=0.003..0.021 rows=141 loops=1)

80. 0.005 5.339 ↑ 1.0 3 1

Subquery Scan on "*SELECT* 2" (cost=1,034.36..1,265.09 rows=3 width=3,015) (actual time=5.125..5.339 rows=3 loops=1)

81. 0.054 5.334 ↑ 1.0 3 1

Hash Left Join (cost=1,034.36..1,265.06 rows=3 width=3,015) (actual time=5.123..5.334 rows=3 loops=1)

  • Hash Cond: (pr_1.patient_category_id = prcm_1.category_id)
82. 0.007 5.236 ↑ 1.0 3 1

Hash Left Join (cost=1,028.19..1,258.60 rows=3 width=3,001) (actual time=5.046..5.236 rows=3 loops=1)

  • Hash Cond: ((b_1.visit_id)::text = (isr_1.incoming_visit_id)::text)
83. 0.010 5.221 ↑ 1.0 3 1

Nested Loop Left Join (cost=1,026.81..1,257.19 rows=3 width=2,437) (actual time=5.033..5.221 rows=3 loops=1)

84. 0.005 5.145 ↑ 1.0 3 1

Nested Loop Left Join (cost=1,019.00..1,245.63 rows=3 width=2,298) (actual time=5.007..5.145 rows=3 loops=1)

85. 0.007 5.128 ↑ 1.0 3 1

Nested Loop Left Join (cost=1,018.71..1,222.69 rows=3 width=2,285) (actual time=4.999..5.128 rows=3 loops=1)

86. 0.008 5.121 ↑ 1.0 3 1

Nested Loop Left Join (cost=1,018.44..1,202.29 rows=3 width=2,274) (actual time=4.996..5.121 rows=3 loops=1)

87. 0.009 5.095 ↑ 1.0 3 1

Nested Loop Left Join (cost=1,018.17..1,181.89 rows=3 width=2,262) (actual time=4.985..5.095 rows=3 loops=1)

88. 0.009 5.056 ↑ 1.0 3 1

Hash Left Join (cost=1,017.75..1,158.47 rows=3 width=2,229) (actual time=4.970..5.056 rows=3 loops=1)

  • Hash Cond: ((bc_1.act_department_id)::text = tdep_1.dept_id)
89. 0.008 4.981 ↑ 1.0 3 1

Hash Left Join (cost=1,010.40..1,151.10 rows=3 width=2,204) (actual time=4.897..4.981 rows=3 loops=1)

  • Hash Cond: (bc_1.account_group = bcagm_1.account_group_id)
90. 0.007 4.970 ↑ 1.0 3 1

Hash Left Join (cost=1,009.31..1,149.96 rows=3 width=1,790) (actual time=4.889..4.970 rows=3 loops=1)

  • Hash Cond: (chc_1.account_head_id = bahc_1.account_head_id)
91. 0.009 4.956 ↑ 1.0 3 1

Hash Left Join (cost=1,007.84..1,148.45 rows=3 width=1,676) (actual time=4.877..4.956 rows=3 loops=1)

  • Hash Cond: ((chc_1.chargegroup_id)::text = (cgc_1.chargegroup_id)::text)
92. 0.008 4.939 ↑ 1.0 3 1

Hash Left Join (cost=1,006.43..1,147.00 rows=3 width=1,562) (actual time=4.864..4.939 rows=3 loops=1)

  • Hash Cond: ((bc_1.charge_head)::text = (chc_1.chargehead_id)::text)
93. 0.006 4.904 ↑ 1.0 3 1

Nested Loop Left Join (cost=1,004.04..1,144.57 rows=3 width=1,544) (actual time=4.831..4.904 rows=3 loops=1)

94. 0.006 4.895 ↑ 1.0 3 1

Hash Left Join (cost=1,003.89..1,132.49 rows=3 width=1,032) (actual time=4.828..4.895 rows=3 loops=1)

  • Hash Cond: (rpt_1.card_type_id = ctm_1.card_type_id)
95. 0.015 4.886 ↑ 1.0 3 1

Hash Left Join (cost=1,002.83..1,131.38 rows=3 width=918) (actual time=4.820..4.886 rows=3 loops=1)

  • Hash Cond: (((bc_1.charge_id)::text = (bcra_1.charge_id)::text) AND (r_1.bill_receipt_id = bcra_1.bill_receipt_id))
96. 0.010 4.864 ↑ 1.0 3 1

Nested Loop Left Join (cost=984.58..1,112.86 rows=3 width=900) (actual time=4.803..4.864 rows=3 loops=1)

97. 0.010 4.794 ↑ 1.0 3 1

Nested Loop (cost=977.40..1,101.22 rows=3 width=671) (actual time=4.778..4.794 rows=3 loops=1)

98. 0.006 4.765 ↑ 1.0 1 1

Nested Loop (cost=973.19..1,049.10 rows=1 width=608) (actual time=4.755..4.765 rows=1 loops=1)

  • Join Filter: (rpt_1.payment_mode_id = pm_1.mode_id)
  • Rows Removed by Join Filter: 14
99. 0.005 4.756 ↑ 1.0 1 1

Nested Loop (cost=973.19..1,047.85 rows=1 width=534) (actual time=4.750..4.756 rows=1 loops=1)

  • Join Filter: (b_1.visit_type = vtn_1.visit_type)
  • Rows Removed by Join Filter: 3
100. 0.010 4.750 ↑ 1.0 1 1

Nested Loop (cost=973.19..1,046.76 rows=1 width=504) (actual time=4.745..4.750 rows=1 loops=1)

  • Join Filter: ((rpt_1.counter)::text = (c_1.counter_id)::text)
  • Rows Removed by Join Filter: 9
101. 0.004 4.738 ↑ 1.0 1 1

Nested Loop (cost=973.19..1,045.54 rows=1 width=278) (actual time=4.736..4.738 rows=1 loops=1)

102. 0.007 4.720 ↑ 1.0 1 1

Nested Loop (cost=972.76..1,037.72 rows=1 width=223) (actual time=4.719..4.720 rows=1 loops=1)

103. 0.215 4.698 ↑ 1.0 1 1

Hash Join (cost=972.33..1,029.82 rows=1 width=210) (actual time=4.698..4.698 rows=1 loops=1)

  • Hash Cond: ((rrr.refund_receipt_id)::text = (rpt_1.receipt_id)::text)
104. 0.173 0.173 ↓ 1.0 2,581 1

Seq Scan on receipt_refund_reference rrr (cost=0.00..47.80 rows=2,580 width=18) (actual time=0.005..0.173 rows=2,581 loops=1)

105. 0.003 4.310 ↑ 28.0 1 1

Hash (cost=971.98..971.98 rows=28 width=201) (actual time=4.310..4.310 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
106. 4.307 4.307 ↑ 28.0 1 1

Index Scan using receipt_receipt_type_idx on receipts rpt_1 (cost=0.42..971.98 rows=28 width=201) (actual time=0.026..4.307 rows=1 loops=1)

  • Index Cond: ((receipt_type)::text = 'F'::text)
  • Filter: ((NOT is_deposit) AND (payment_mode_id <> (-9)) AND (date(display_date) = '2020-08-03'::date))
  • Rows Removed by Filter: 5,386
107. 0.015 0.015 ↑ 1.0 1 1

Index Scan using bill_receipts_receipt_no_index on bill_receipts r_1 (cost=0.42..7.89 rows=1 width=31) (actual time=0.014..0.015 rows=1 loops=1)

  • Index Cond: ((receipt_no)::text = (rrr.receipt_id)::text)
108. 0.014 0.014 ↑ 1.0 1 1

Index Scan using bill_pkey on bill b_1 (cost=0.43..7.81 rows=1 width=55) (actual time=0.013..0.014 rows=1 loops=1)

  • Index Cond: ((bill_no)::text = (r_1.bill_no)::text)
109. 0.002 0.002 ↑ 1.0 10 1

Seq Scan on counters c_1 (cost=0.00..1.10 rows=10 width=292) (actual time=0.001..0.002 rows=10 loops=1)

110. 0.001 0.001 ↑ 1.0 4 1

Seq Scan on visit_type_names vtn_1 (cost=0.00..1.04 rows=4 width=40) (actual time=0.001..0.001 rows=4 loops=1)

111. 0.003 0.003 ↓ 1.4 15 1

Seq Scan on payment_mode_master pm_1 (cost=0.00..1.11 rows=11 width=82) (actual time=0.001..0.003 rows=15 loops=1)

112. 0.006 0.019 ↑ 4.3 3 1

Bitmap Heap Scan on bill_charge bc_1 (cost=4.22..51.99 rows=13 width=79) (actual time=0.017..0.019 rows=3 loops=1)

  • Recheck Cond: ((bill_no)::text = (r_1.bill_no)::text)
113. 0.013 0.013 ↑ 4.3 3 1

Bitmap Index Scan on bill_charge_bill_no_index (cost=0.00..4.21 rows=13 width=0) (actual time=0.013..0.013 rows=3 loops=1)

  • Index Cond: ((bill_no)::text = (r_1.bill_no)::text)
114. 0.039 0.060 ↑ 1.0 1 3

Hash Right Join (cost=7.17..8.65 rows=1 width=237) (actual time=0.013..0.020 rows=1 loops=3)

  • Hash Cond: (sg_1.service_group_id = ssg_1.service_group_id)
115. 0.006 0.006 ↑ 1.0 34 3

Seq Scan on service_groups sg_1 (cost=0.00..1.34 rows=34 width=222) (actual time=0.001..0.002 rows=34 loops=3)

116. 0.003 0.015 ↑ 1.0 1 3

Hash (cost=7.16..7.16 rows=1 width=23) (actual time=0.005..0.005 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
117. 0.012 0.012 ↑ 1.0 1 3

Index Scan using service_sub_groups_pkey on service_sub_groups ssg_1 (cost=0.28..7.16 rows=1 width=23) (actual time=0.004..0.004 rows=1 loops=3)

  • Index Cond: (service_sub_group_id = bc_1.service_sub_group_id)
118. 0.003 0.007 ↑ 36.7 9 1

Hash (cost=13.30..13.30 rows=330 width=82) (actual time=0.007..0.007 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
119. 0.004 0.004 ↑ 36.7 9 1

Seq Scan on bill_charge_receipt_allocation bcra_1 (cost=0.00..13.30 rows=330 width=82) (actual time=0.002..0.004 rows=9 loops=1)

120. 0.002 0.003 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=122) (actual time=0.003..0.003 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
121. 0.001 0.001 ↑ 1.0 3 1

Seq Scan on card_type_master ctm_1 (cost=0.00..1.03 rows=3 width=122) (actual time=0.001..0.001 rows=3 loops=1)

122. 0.003 0.003 ↓ 0.0 0 3

Index Scan using foreign_currency_pkey on foreign_currency fc_1 (cost=0.14..4.02 rows=1 width=520) (actual time=0.001..0.001 rows=0 loops=3)

  • Index Cond: (currency_id = rpt_1.currency_id)
123. 0.020 0.027 ↑ 1.0 62 1

Hash (cost=1.62..1.62 rows=62 width=30) (actual time=0.027..0.027 rows=62 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 4kB
124. 0.007 0.007 ↑ 1.0 62 1

Seq Scan on chargehead_constants chc_1 (cost=0.00..1.62 rows=62 width=30) (actual time=0.002..0.007 rows=62 loops=1)

125. 0.002 0.008 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=156) (actual time=0.008..0.008 rows=18 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
126. 0.006 0.006 ↑ 1.0 18 1

Seq Scan on chargegroup_constants cgc_1 (cost=0.00..1.18 rows=18 width=156) (actual time=0.001..0.006 rows=18 loops=1)

127. 0.002 0.007 ↑ 1.0 21 1

Hash (cost=1.21..1.21 rows=21 width=122) (actual time=0.007..0.007 rows=21 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 2kB
128. 0.005 0.005 ↑ 1.0 21 1

Seq Scan on bill_account_heads bahc_1 (cost=0.00..1.21 rows=21 width=122) (actual time=0.002..0.005 rows=21 loops=1)

129. 0.001 0.003 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=422) (actual time=0.003..0.003 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
130. 0.002 0.002 ↑ 1.0 4 1

Seq Scan on account_group_master bcagm_1 (cost=0.00..1.04 rows=4 width=422) (actual time=0.002..0.002 rows=4 loops=1)

131. 0.018 0.066 ↑ 1.0 100 1

Hash (cost=6.10..6.10 rows=100 width=64) (actual time=0.066..0.066 rows=100 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 6kB
132. 0.011 0.048 ↑ 1.0 100 1

Subquery Scan on tdep_1 (cost=0.00..6.10 rows=100 width=64) (actual time=0.005..0.048 rows=100 loops=1)

133. 0.003 0.037 ↑ 1.0 100 1

Append (cost=0.00..5.10 rows=100 width=123) (actual time=0.004..0.037 rows=100 loops=1)

134. 0.004 0.004 ↑ 1.0 7 1

Seq Scan on services_departments services_departments_1 (cost=0.00..1.10 rows=7 width=162) (actual time=0.003..0.004 rows=7 loops=1)

135. 0.005 0.011 ↑ 1.0 25 1

Subquery Scan on "*SELECT* 2_2" (cost=0.00..1.56 rows=25 width=394) (actual time=0.004..0.011 rows=25 loops=1)

136. 0.006 0.006 ↑ 1.0 25 1

Seq Scan on diagnostics_departments diagnostics_departments_1 (cost=0.00..1.31 rows=25 width=394) (actual time=0.003..0.006 rows=25 loops=1)

137. 0.010 0.019 ↑ 1.0 68 1

Subquery Scan on "*SELECT* 3_1" (cost=0.00..2.36 rows=68 width=20) (actual time=0.005..0.019 rows=68 loops=1)

138. 0.009 0.009 ↑ 1.0 68 1

Seq Scan on department department_1 (cost=0.00..1.68 rows=68 width=20) (actual time=0.003..0.009 rows=68 loops=1)

139. 0.030 0.030 ↑ 1.0 1 3

Index Scan using patient_registration_pkey on patient_registration pr_1 (cost=0.42..7.80 rows=1 width=42) (actual time=0.010..0.010 rows=1 loops=3)

  • Index Cond: ((patient_id)::text = (b_1.visit_id)::text)
140. 0.018 0.018 ↑ 1.0 1 3

Index Scan using tpa_master_pkey on tpa_master ptm_1 (cost=0.27..6.79 rows=1 width=31) (actual time=0.006..0.006 rows=1 loops=3)

  • Index Cond: ((tpa_id)::text = (pr_1.primary_sponsor_id)::text)
141. 0.000 0.000 ↓ 0.0 0 3

Index Scan using tpa_master_pkey on tpa_master stm_1 (cost=0.27..6.79 rows=1 width=31) (actual time=0.000..0.000 rows=0 loops=3)

  • Index Cond: ((tpa_id)::text = (pr_1.secondary_sponsor_id)::text)
142. 0.012 0.012 ↓ 0.0 0 3

Index Scan using pharmacy_retail_customers_pkey on store_retail_customers prc_1 (cost=0.29..7.63 rows=1 width=13) (actual time=0.004..0.004 rows=0 loops=3)

  • Index Cond: ((customer_id)::text = (b_1.visit_id)::text)
143. 0.027 0.066 ↑ 1.0 1 3

Hash Right Join (cost=7.81..9.05 rows=1 width=149) (actual time=0.017..0.022 rows=1 loops=3)

  • Hash Cond: ((smb_1.salutation_id)::text = (pd_1.salutation)::text)
144. 0.003 0.003 ↑ 1.0 17 3

Seq Scan on salutation_master smb_1 (cost=0.00..1.17 rows=17 width=156) (actual time=0.001..0.001 rows=17 loops=3)

145. 0.006 0.036 ↑ 1.0 1 3

Hash (cost=7.79..7.79 rows=1 width=40) (actual time=0.012..0.012 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
146. 0.030 0.030 ↑ 1.0 1 3

Index Scan using patient_details_pkey on patient_details pd_1 (cost=0.42..7.79 rows=1 width=40) (actual time=0.010..0.010 rows=1 loops=3)

  • Index Cond: ((mr_no)::text = (pr_1.mr_no)::text)
147. 0.004 0.008 ↑ 1.0 17 1

Hash (cost=1.17..1.17 rows=17 width=564) (actual time=0.008..0.008 rows=17 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
148. 0.004 0.004 ↑ 1.0 17 1

Seq Scan on incoming_sample_registration isr_1 (cost=0.00..1.17 rows=17 width=564) (actual time=0.002..0.004 rows=17 loops=1)

149. 0.026 0.044 ↑ 1.0 141 1

Hash (cost=4.41..4.41 rows=141 width=22) (actual time=0.044..0.044 rows=141 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
150. 0.018 0.018 ↑ 1.0 141 1

Seq Scan on patient_category_master prcm_1 (cost=0.00..4.41 rows=141 width=22) (actual time=0.003..0.018 rows=141 loops=1)

Total runtime : 2,047.113 ms