explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iBhy : Optimization for: Optimization for: plan #Dr7b; plan #Cuqw

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.004 2,038.981 ↑ 703.0 16 1

Append (cost=231,343.14..346,814.88 rows=11,248 width=3,015) (actual time=2,022.042..2,038.981 rows=16 loops=1)

2. 0.082 2,024.581 ↑ 865.0 13 1

Hash Left Join (cost=231,343.14..345,437.34 rows=11,245 width=3,015) (actual time=2,022.042..2,024.581 rows=13 loops=1)

  • Hash Cond: (pr.patient_category_id = prcm.category_id)
3. 0.020 2,024.458 ↑ 865.0 13 1

Nested Loop Left Join (cost=231,336.97..344,264.50 rows=11,245 width=3,001) (actual time=2,021.969..2,024.458 rows=13 loops=1)

4. 0.008 2,024.230 ↑ 865.0 13 1

Hash Left Join (cost=231,329.16..330,158.28 rows=11,245 width=2,862) (actual time=2,021.929..2,024.230 rows=13 loops=1)

  • Hash Cond: ((b.visit_id)::text = (isr.incoming_visit_id)::text)
5. 0.007 2,024.211 ↑ 865.0 13 1

Hash Left Join (cost=231,327.78..330,114.72 rows=11,245 width=2,298) (actual time=2,021.915..2,024.211 rows=13 loops=1)

  • Hash Cond: ((pr.secondary_sponsor_id)::text = (stm.tpa_id)::text)
6. 0.011 2,024.118 ↑ 865.0 13 1

Hash Left Join (cost=231,311.61..330,056.35 rows=11,245 width=2,287) (actual time=2,021.826..2,024.118 rows=13 loops=1)

  • Hash Cond: ((pr.primary_sponsor_id)::text = (ptm.tpa_id)::text)
7. 0.010 2,024.012 ↑ 865.0 13 1

Hash Left Join (cost=231,295.45..329,888.37 rows=11,245 width=2,275) (actual time=2,021.725..2,024.012 rows=13 loops=1)

  • Hash Cond: ((bc.act_department_id)::text = tdep.dept_id)
8. 0.019 2,023.931 ↑ 865.0 13 1

Hash Left Join (cost=231,288.10..329,757.69 rows=11,245 width=2,250) (actual time=2,021.649..2,023.931 rows=13 loops=1)

  • Hash Cond: (bc.account_group = bcagm.account_group_id)
9. 6.743 2,023.906 ↑ 865.0 13 1

Hash Left Join (cost=231,287.01..329,601.98 rows=11,245 width=1,836) (actual time=2,021.631..2,023.906 rows=13 loops=1)

  • Hash Cond: ((b.visit_id)::text = (pr.patient_id)::text)
10. 3.912 1,580.348 ↑ 865.0 13 1

Hash Left Join (cost=194,139.21..282,654.40 rows=11,245 width=1,803) (actual time=1,557.017..1,580.348 rows=13 loops=1)

  • Hash Cond: ((b.visit_id)::text = (prc.customer_id)::text)
11. 0.007 1,543.707 ↑ 865.0 13 1

Hash Left Join (cost=192,511.33..275,736.59 rows=11,245 width=1,790) (actual time=1,501.734..1,543.707 rows=13 loops=1)

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

Hash Left Join (cost=192,498.63..275,577.84 rows=11,245 width=1,278) (actual time=1,501.730..1,543.699 rows=13 loops=1)

  • Hash Cond: (rpt.card_type_id = ctm.card_type_id)
13. 0.017 1,543.683 ↑ 865.0 13 1

Hash Left Join (cost=192,497.57..275,422.16 rows=11,245 width=1,164) (actual time=1,501.721..1,543.683 rows=13 loops=1)

  • Hash Cond: (bc.service_sub_group_id = ssg.service_sub_group_id)
14. 0.015 1,543.266 ↑ 865.0 13 1

Hash Left Join (cost=192,450.41..275,220.39 rows=11,245 width=935) (actual time=1,501.317..1,543.266 rows=13 loops=1)

  • Hash Cond: ((bc.charge_head)::text = (chc.chargehead_id)::text)
15. 0.037 1,543.177 ↑ 865.0 13 1

Hash Left Join (cost=192,443.44..275,058.79 rows=11,245 width=689) (actual time=1,501.238..1,543.177 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.016 1,543.121 ↑ 865.0 13 1

Hash Join (cost=192,425.19..274,056.59 rows=11,245 width=671) (actual time=1,501.201..1,543.121 rows=13 loops=1)

  • Hash Cond: (rpt.payment_mode_id = pm.mode_id)
17. 0.016 1,543.082 ↑ 865.0 13 1

Hash Join (cost=192,423.94..273,900.73 rows=11,245 width=597) (actual time=1,501.169..1,543.082 rows=13 loops=1)

  • Hash Cond: (b.visit_type = vtn.visit_type)
18. 0.020 1,543.057 ↑ 865.0 13 1

Hash Join (cost=192,422.85..273,745.02 rows=11,245 width=567) (actual time=1,501.152..1,543.057 rows=13 loops=1)

  • Hash Cond: ((rpt.counter)::text = (c.counter_id)::text)
19. 275.970 1,543.018 ↑ 865.0 13 1

Hash Join (cost=192,421.62..273,589.18 rows=11,245 width=341) (actual time=1,501.125..1,543.018 rows=13 loops=1)

  • Hash Cond: ((b.bill_no)::text = (r.bill_no)::text)
20. 373.387 373.387 ↑ 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.007..373.387 rows=1,080,041 loops=1)

21. 18.168 893.661 ↑ 865.0 13 1

Hash (cost=191,830.06..191,830.06 rows=11,245 width=302) (actual time=893.661..893.661 rows=13 loops=1)

  • Buckets: 1,024 Batches: 4 Memory Usage: 2kB
22. 177.877 875.493 ↑ 865.0 13 1

Hash Join (cost=57,926.53..191,830.06 rows=11,245 width=302) (actual time=875.469..875.493 rows=13 loops=1)

  • Hash Cond: ((bc.bill_no)::text = (r.bill_no)::text)
23. 312.993 312.993 ↑ 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.007..312.993 rows=2,239,924 loops=1)

24. 0.006 384.623 ↑ 766.6 5 1

Hash (cost=57,878.62..57,878.62 rows=3,833 width=223) (actual time=384.623..384.623 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
25. 56.225 384.617 ↑ 766.6 5 1

Hash Join (cost=31,382.78..57,878.62 rows=3,833 width=223) (actual time=384.611..384.617 rows=5 loops=1)

  • Hash Cond: ((r.receipt_no)::text = (rpt.receipt_id)::text)
26. 62.934 62.934 ↓ 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..62.934 rows=772,550 loops=1)

27. 0.007 265.458 ↑ 766.8 5 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
28. 265.451 265.451 ↑ 766.8 5 1

Seq Scan on receipts rpt (cost=0.00..31,334.86 rows=3,834 width=201) (actual time=265.445..265.451 rows=5 loops=1)

  • Filter: ((NOT is_deposit) AND (payment_mode_id <> (-9)) AND ((receipt_type)::text = 'R'::text) AND (date(display_date) = '2020-08-03'::date))
  • Rows Removed by Filter: 772,645
29. 0.006 0.019 ↑ 1.0 10 1

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

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

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

31. 0.002 0.009 ↑ 1.0 4 1

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

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

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

33. 0.006 0.023 ↓ 1.4 15 1

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

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

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

35. 0.005 0.019 ↑ 36.7 9 1

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

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

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

37. 0.010 0.074 ↑ 1.0 62 1

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

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

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

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

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

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

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

41. 0.004 0.009 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=156) (actual time=0.009..0.009 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.004..0.005 rows=18 loops=1)

43. 0.001 0.010 ↑ 1.0 21 1

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

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

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

45. 0.122 0.400 ↑ 1.0 921 1

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

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

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

  • Hash Cond: (ssg.service_group_id = sg.service_group_id)
47. 0.077 0.077 ↑ 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.077 rows=921 loops=1)

48. 0.008 0.014 ↑ 1.0 34 1

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

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

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

50. 0.001 0.005 ↑ 1.0 3 1

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

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

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

52. 0.000 0.001 ↓ 0.0 0 1

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

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

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

54. 27.467 32.729 ↑ 1.0 45,328 1

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

  • Buckets: 4,096 Batches: 4 Memory Usage: 508kB
55. 5.262 5.262 ↑ 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.006..5.262 rows=45,328 loops=1)

56. 211.562 436.815 ↓ 1.0 520,305 1

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

  • Buckets: 2,048 Batches: 64 Memory Usage: 548kB
57. 225.253 225.253 ↓ 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..225.253 rows=520,305 loops=1)

58. 0.002 0.006 ↑ 1.0 4 1

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

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

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

60. 0.016 0.071 ↑ 1.0 100 1

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

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

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

62. 0.005 0.047 ↑ 1.0 100 1

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

63. 0.013 0.013 ↑ 1.0 7 1

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

64. 0.003 0.013 ↑ 1.0 25 1

Subquery Scan on "*SELECT* 2_1" (cost=0.00..1.56 rows=25 width=394) (actual time=0.006..0.013 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.006..0.010 rows=25 loops=1)

66. 0.007 0.016 ↑ 1.0 68 1

Subquery Scan on "*SELECT* 3" (cost=0.00..2.36 rows=68 width=20) (actual time=0.004..0.016 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.048 0.095 ↑ 1.0 363 1

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

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

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

70. 0.043 0.086 ↑ 1.0 363 1

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

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

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

72. 0.005 0.011 ↑ 1.0 17 1

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

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

Seq Scan on incoming_sample_registration isr (cost=0.00..1.17 rows=17 width=564) (actual time=0.005..0.006 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.016 0.041 ↑ 1.0 141 1

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

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

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

80. 0.005 14.396 ↑ 1.0 3 1

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

81. 0.036 14.391 ↑ 1.0 3 1

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

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

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

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

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

84. 0.002 14.252 ↑ 1.0 3 1

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

85. 0.003 14.241 ↑ 1.0 3 1

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

86. 0.003 14.238 ↑ 1.0 3 1

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

87. 0.005 14.211 ↑ 1.0 3 1

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

88. 0.006 14.185 ↑ 1.0 3 1

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

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

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

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

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

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

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

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

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

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

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

94. 0.004 14.062 ↑ 1.0 3 1

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

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

Hash Left Join (cost=1,002.83..1,131.38 rows=3 width=918) (actual time=13.992..14.056 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.008 14.040 ↑ 1.0 3 1

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

97. 0.005 13.963 ↑ 1.0 3 1

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

98. 0.005 13.933 ↑ 1.0 1 1

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

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

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

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

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

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

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

102. 0.006 13.896 ↑ 1.0 1 1

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

103. 0.185 13.874 ↑ 1.0 1 1

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

  • Hash Cond: ((rrr.refund_receipt_id)::text = (rpt_1.receipt_id)::text)
104. 0.209 0.209 ↓ 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.012..0.209 rows=2,581 loops=1)

105. 0.004 13.480 ↑ 28.0 1 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
106. 13.476 13.476 ↑ 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.032..13.476 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.016 0.016 ↑ 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.016..0.016 rows=1 loops=1)

  • Index Cond: ((receipt_no)::text = (rrr.receipt_id)::text)
108. 0.015 0.015 ↑ 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.015..0.015 rows=1 loops=1)

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

Seq Scan on counters c_1 (cost=0.00..1.10 rows=10 width=292) (actual time=0.001..0.003 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.001 0.001 ↓ 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.001 rows=15 loops=1)

112. 0.003 0.025 ↑ 4.3 3 1

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

  • Recheck Cond: ((bill_no)::text = (r_1.bill_no)::text)
113. 0.022 0.022 ↑ 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.022..0.022 rows=3 loops=1)

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

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

  • Hash Cond: (sg_1.service_group_id = ssg_1.service_group_id)
115. 0.030 0.030 ↑ 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.010 rows=34 loops=3)

116. 0.006 0.012 ↑ 1.0 1 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
117. 0.006 0.006 ↑ 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.002..0.002 rows=1 loops=3)

  • Index Cond: (service_sub_group_id = bc_1.service_sub_group_id)
118. 0.002 0.005 ↑ 36.7 9 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
119. 0.003 0.003 ↑ 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.001..0.003 rows=9 loops=1)

120. 0.001 0.002 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=122) (actual time=0.002..0.002 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.010 0.021 ↑ 1.0 62 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 4kB
124. 0.011 0.011 ↑ 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.011 rows=62 loops=1)

125. 0.003 0.006 ↑ 1.0 18 1

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

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

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

127. 0.003 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.004 0.004 ↑ 1.0 21 1

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

129. 0.000 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.003 0.003 ↑ 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.003 rows=4 loops=1)

131. 0.013 0.055 ↑ 1.0 100 1

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

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

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

133. 0.004 0.030 ↑ 1.0 100 1

Append (cost=0.00..5.10 rows=100 width=123) (actual time=0.003..0.030 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.003 0.007 ↑ 1.0 25 1

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

136. 0.004 0.004 ↑ 1.0 25 1

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

137. 0.006 0.015 ↑ 1.0 68 1

Subquery Scan on "*SELECT* 3_1" (cost=0.00..2.36 rows=68 width=20) (actual time=0.004..0.015 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.021 0.021 ↑ 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.007..0.007 rows=1 loops=3)

  • Index Cond: ((patient_id)::text = (b_1.visit_id)::text)
140. 0.024 0.024 ↑ 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.008..0.008 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.009 0.009 ↓ 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.003..0.003 rows=0 loops=3)

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

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

  • Hash Cond: ((smb_1.salutation_id)::text = (pd_1.salutation)::text)
144. 0.006 0.006 ↑ 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.002 rows=17 loops=3)

145. 0.003 0.027 ↑ 1.0 1 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
146. 0.024 0.024 ↑ 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.007..0.008 rows=1 loops=3)

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

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

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

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

149. 0.018 0.037 ↑ 1.0 141 1

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

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

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

Total runtime : 2,040.492 ms