explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cuqw : Optimization for: plan #Dr7b

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.008 2,091.431 ↑ 703.0 16 1

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

2. 0.061 2,086.865 ↑ 865.0 13 1

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

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

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

4. 0.005 2,086.567 ↑ 865.0 13 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

21. 16.324 873.910 ↑ 865.0 13 1

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

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

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

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

24. 0.004 374.475 ↑ 766.6 5 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
25. 55.703 374.471 ↑ 766.6 5 1

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

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

27. 0.007 256.374 ↑ 766.8 5 1

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

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

Seq Scan on receipts rpt (cost=0.00..31,334.86 rows=3,834 width=201) (actual time=256.365..256.367 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.003 0.004 ↑ 1.0 10 1

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

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

Seq Scan on counters c (cost=0.00..1.10 rows=10 width=292) (actual time=0.001..0.001 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.002..0.002 rows=4 loops=1)

33. 0.002 0.018 ↓ 1.4 15 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
34. 0.016 0.016 ↓ 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.016 rows=15 loops=1)

35. 0.004 0.008 ↑ 36.7 9 1

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

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

37. 0.012 0.068 ↑ 1.0 62 1

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

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

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

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

Hash Left Join (cost=1.41..3.88 rows=62 width=144) (actual time=0.013..0.034 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.003..0.006 rows=62 loops=1)

41. 0.004 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
42. 0.002 0.002 ↑ 1.0 18 1

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

43. 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
44. 0.005 0.005 ↑ 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.005 rows=21 loops=1)

45. 0.123 0.379 ↑ 1.0 921 1

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

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

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

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

48. 0.006 0.010 ↑ 1.0 34 1

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

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

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

50. 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
51. 0.001 0.001 ↑ 1.0 3 1

Seq Scan on card_type_master ctm (cost=0.00..1.03 rows=3 width=122) (actual time=0.001..0.001 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. 36.194 40.946 ↑ 1.0 45,328 1

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

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

56. 283.291 509.999 ↓ 1.0 520,305 1

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

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

58. 0.002 0.008 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=422) (actual time=0.008..0.008 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.006..0.006 rows=4 loops=1)

60. 0.012 0.056 ↑ 1.0 100 1

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

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

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

62. 0.008 0.034 ↑ 1.0 100 1

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

63. 0.004 0.004 ↑ 1.0 7 1

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

64. 0.002 0.009 ↑ 1.0 25 1

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

65. 0.007 0.007 ↑ 1.0 25 1

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

66. 0.003 0.013 ↑ 1.0 68 1

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

67. 0.010 0.010 ↑ 1.0 68 1

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

68. 0.045 0.090 ↑ 1.0 363 1

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

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

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

70. 0.048 0.081 ↑ 1.0 363 1

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

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

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

72. 0.001 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.005 0.005 ↑ 1.0 17 1

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

74. 0.065 0.182 ↑ 1.0 1 13

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

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

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

76. 0.013 0.104 ↑ 1.0 1 13

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
77. 0.091 0.091 ↑ 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.007..0.007 rows=1 loops=13)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
78. 0.025 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
79. 0.012 0.012 ↑ 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.012 rows=141 loops=1)

80. 0.005 4.558 ↑ 1.0 3 1

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

81. 0.042 4.553 ↑ 1.0 3 1

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

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

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

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

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

84. 0.003 4.416 ↑ 1.0 3 1

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

85. 0.002 4.404 ↑ 1.0 3 1

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

86. 0.003 4.402 ↑ 1.0 3 1

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

87. 0.004 4.384 ↑ 1.0 3 1

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

88. 0.006 4.359 ↑ 1.0 3 1

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

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

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

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

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

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

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

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

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

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

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

94. 0.005 4.241 ↑ 1.0 3 1

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

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

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

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

97. 0.005 4.174 ↑ 1.0 3 1

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

98. 0.006 4.155 ↑ 1.0 1 1

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

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

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

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

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

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

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

102. 0.006 4.123 ↑ 1.0 1 1

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

103. 0.193 4.107 ↑ 1.0 1 1

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

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

105. 0.002 3.768 ↑ 28.0 1 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
106. 3.766 3.766 ↑ 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.022..3.766 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.010 0.010 ↑ 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.010..0.010 rows=1 loops=1)

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

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

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

110. 0.002 0.002 ↑ 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.002 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.014 ↑ 4.3 3 1

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

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

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

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

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

116. 0.003 0.009 ↑ 1.0 1 3

Hash (cost=7.16..7.16 rows=1 width=23) (actual time=0.003..0.003 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.001 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.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.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.000 0.000 ↓ 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.000..0.000 rows=0 loops=3)

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

Hash (cost=1.62..1.62 rows=62 width=30) (actual time=0.020..0.020 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.001..0.003 rows=18 loops=1)

127. 0.001 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.006 0.006 ↑ 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.006 rows=21 loops=1)

129. 0.000 0.002 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=422) (actual time=0.002..0.002 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.001..0.002 rows=4 loops=1)

131. 0.018 0.053 ↑ 1.0 100 1

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

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

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

133. 0.004 0.029 ↑ 1.0 100 1

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

134. 0.003 0.003 ↑ 1.0 7 1

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

135. 0.002 0.009 ↑ 1.0 25 1

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

136. 0.007 0.007 ↑ 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.007 rows=25 loops=1)

137. 0.004 0.013 ↑ 1.0 68 1

Subquery Scan on "*SELECT* 3_1" (cost=0.00..2.36 rows=68 width=20) (actual time=0.003..0.013 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.002..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.015 0.015 ↑ 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.004..0.005 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.018 0.045 ↑ 1.0 1 3

Hash Right Join (cost=7.81..9.05 rows=1 width=149) (actual time=0.011..0.015 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.024 ↑ 1.0 1 3

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

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

  • Index Cond: ((mr_no)::text = (pr_1.mr_no)::text)
147. 0.002 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
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.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,092.191 ms