explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ndru

Settings
# exclusive inclusive rows x rows loops node
1. 162.287 836,679.654 ↓ 65.3 57,345 1

Nested Loop Left Join (cost=78,551,817.22..78,596,288.95 rows=878 width=561) (actual time=836,270.958..836,679.654 rows=57,345 loops=1)

2. 430.910 836,517.367 ↓ 65.3 57,345 1

Merge Left Join (cost=78,551,816.80..78,594,265.24 rows=878 width=505) (actual time=836,270.874..836,517.367 rows=57,345 loops=1)

  • Merge Cond: ((icl.claim_id)::text = (insurance_claim_resubmission.claim_id)::text)
3. 707.447 812,986.858 ↓ 65.3 57,345 1

Sort (cost=78,053,459.63..78,053,461.83 rows=878 width=487) (actual time=812,943.610..812,986.858 rows=57,345 loops=1)

  • Sort Key: icl.claim_id
  • Sort Method: external merge Disk: 16016kB
4. 2,146.187 812,279.411 ↓ 65.3 57,345 1

Merge Right Join (cost=77,397,464.89..78,053,416.71 rows=878 width=487) (actual time=811,972.163..812,279.411 rows=57,345 loops=1)

  • Merge Cond: ((all_insurance_remittance_details_view.bill_no)::text = (b.bill_no)::text)
5. 3,773.216 789,906.444 ↓ 2.1 9,439,998 1

GroupAggregate (cost=76,600,912.17..77,201,267.52 rows=4,447,077 width=388) (actual time=780,445.706..789,906.444 rows=9,439,998 loops=1)

  • Group Key: all_insurance_remittance_details_view.bill_no, all_insurance_remittance_details_view.payment_reference, all_insurance_remittance_details_view.reference_no
6. 62,747.334 786,133.228 ↑ 4.7 9,525,298 1

Sort (cost=76,600,912.17..76,712,089.09 rows=44,470,766 width=388) (actual time=780,445.692..786,133.228 rows=9,525,298 loops=1)

  • Sort Key: all_insurance_remittance_details_view.bill_no, all_insurance_remittance_details_view.payment_reference, all_insurance_remittance_details_view.reference_no
  • Sort Method: external merge Disk: 480336kB
7. 1,905.889 723,385.894 ↑ 4.7 9,525,414 1

Subquery Scan on all_insurance_remittance_details_view (cost=54,587,853.50..55,143,738.07 rows=44,470,766 width=388) (actual time=714,884.025..723,385.894 rows=9,525,414 loops=1)

8. 58,540.979 721,480.005 ↑ 4.7 9,525,414 1

Sort (cost=54,587,853.50..54,699,030.41 rows=44,470,766 width=400) (actual time=714,884.020..721,480.005 rows=9,525,414 loops=1)

  • Sort Key: bill_charge.bill_no DESC
  • Sort Method: external merge Disk: 518336kB
9. 15,455.795 662,939.026 ↑ 4.7 9,525,414 1

Unique (cost=32,048,444.99..32,826,683.39 rows=44,470,766 width=400) (actual time=573,785.475..662,939.026 rows=9,525,414 loops=1)

10. 420,432.200 647,483.231 ↑ 1.0 43,721,796 1

Sort (cost=32,048,444.99..32,159,621.90 rows=44,470,766 width=400) (actual time=573,785.473..647,483.231 rows=43,721,796 loops=1)

  • Sort Key: bill_charge.bill_no, insurance_payment_allocation.payment_reference, ir.remittance_id, ir.received_date, ir.is_recovery, ir.reference_no
  • Sort Method: external merge Disk: 2372152kB
11. 5,307.876 227,051.031 ↑ 1.0 43,721,796 1

Append (cost=4,019,707.48..10,287,274.89 rows=44,470,766 width=400) (actual time=81,807.112..227,051.031 rows=43,721,796 loops=1)

12. 34,908.041 219,327.136 ↑ 1.0 43,686,604 1

Hash Join (cost=4,019,707.48..7,005,775.99 rows=43,787,192 width=43) (actual time=81,807.111..219,327.136 rows=43,686,604 loops=1)

  • Hash Cond: (insurance_payment_allocation.remittance_id = ir.remittance_id)
13. 81,135.086 183,947.053 ↑ 1.0 43,697,103 1

Hash Join (cost=3,990,181.94..6,259,181.26 rows=43,787,192 width=28) (actual time=81,330.704..183,947.053 rows=43,697,103 loops=1)

  • Hash Cond: ((insurance_payment_allocation.charge_id)::text = (bill_charge.charge_id)::text)
14. 21,491.194 21,491.194 ↑ 1.0 43,697,103 1

Seq Scan on insurance_payment_allocation (cost=0.00..1,343,727.92 rows=43,787,192 width=24) (actual time=0.785..21,491.194 rows=43,697,103 loops=1)

15. 24,127.231 81,320.773 ↑ 1.0 50,386,914 1

Hash (cost=3,058,963.42..3,058,963.42 rows=50,721,642 width=24) (actual time=81,320.773..81,320.773 rows=50,386,914 loops=1)

  • Buckets: 524288 Batches: 256 Memory Usage: 15174kB
16. 57,193.542 57,193.542 ↑ 1.0 50,386,914 1

Seq Scan on bill_charge (cost=0.00..3,058,963.42 rows=50,721,642 width=24) (actual time=0.565..57,193.542 rows=50,386,914 loops=1)

17. 229.196 472.042 ↑ 1.0 567,587 1

Hash (cost=18,644.46..18,644.46 rows=592,646 width=19) (actual time=472.042..472.042 rows=567,587 loops=1)

  • Buckets: 524288 Batches: 4 Memory Usage: 11310kB
18. 242.846 242.846 ↑ 1.0 567,587 1

Seq Scan on insurance_remittance ir (cost=0.00..18,644.46 rows=592,646 width=19) (actual time=0.013..242.846 rows=567,587 loops=1)

19. 25.068 2,059.483 ↓ 0.0 0 1

Gather (cost=1,503,532.52..2,168,117.83 rows=227,858 width=43) (actual time=2,059.256..2,059.483 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
20. 0.001 2,034.415 ↓ 0.0 0 3 / 3

Nested Loop (cost=1,502,532.52..2,144,332.03 rows=94,941 width=43) (actual time=2,034.415..2,034.415 rows=0 loops=3)

21. 54.211 2,034.414 ↓ 0.0 0 3 / 3

Merge Join (cost=1,502,531.96..1,646,654.10 rows=94,941 width=39) (actual time=2,034.414..2,034.414 rows=0 loops=3)

  • Merge Cond: (ipa.remittance_id = ipu.remittance_id)
22. 409.898 1,979.328 ↑ 10.5 868,294 3 / 3

Parallel Index Scan using insurance_payment_allocation_remittance_id_index on insurance_payment_allocation ipa (cost=1,500,045.86..3,841,497.25 rows=9,122,332 width=24) (actual time=1,625.515..1,979.328 rows=868,294 loops=3)

  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 609
23.          

SubPlan (for Parallel Index Scan)

24. 145.914 1,569.430 ↑ 2.8 163,272 3 / 3

Nested Loop (cost=1.13..1,498,906.01 rows=455,716 width=4) (actual time=0.183..1,569.430 rows=163,272 loops=3)

25. 22.324 117.340 ↑ 2.8 163,272 3 / 3

Nested Loop (cost=0.56..63,917.52 rows=455,716 width=14) (actual time=0.097..117.340 rows=163,272 loops=3)

26. 0.188 0.188 ↑ 1.0 302 3 / 3

Seq Scan on insurance_payment_unalloc_amount ipu_2 (cost=0.00..8.02 rows=302 width=4) (actual time=0.031..0.188 rows=302 loops=3)

27. 94.828 94.828 ↑ 2.9 541 906 / 3

Index Scan using insurance_payment_allocation_remittance_id_index on insurance_payment_allocation insurance_payment_allocation_1 (cost=0.56..195.95 rows=1,567 width=14) (actual time=0.008..0.314 rows=541 loops=906)

  • Index Cond: (remittance_id = ipu_2.remittance_id)
28. 1,306.176 1,306.176 ↑ 1.0 1 489,816 / 3

Index Only Scan using bill_charge_pkey on bill_charge bc_2 (cost=0.56..3.15 rows=1 width=10) (actual time=0.008..0.008 rows=1 loops=489,816)

  • Index Cond: (charge_id = (insurance_payment_allocation_1.charge_id)::text)
  • Heap Fetches: 1800
29. 0.140 0.875 ↑ 1.4 222 3 / 3

Sort (cost=2,486.10..2,486.85 rows=302 width=23) (actual time=0.859..0.875 rows=222 loops=3)

  • Sort Key: ipu.remittance_id
  • Sort Method: quicksort Memory: 42kB
30. 0.087 0.735 ↑ 1.4 222 3 / 3

Nested Loop (cost=0.42..2,473.66 rows=302 width=23) (actual time=0.072..0.735 rows=222 loops=3)

31. 0.044 0.044 ↑ 1.0 302 3 / 3

Seq Scan on insurance_payment_unalloc_amount ipu (cost=0.00..8.02 rows=302 width=10) (actual time=0.009..0.044 rows=302 loops=3)

32. 0.604 0.604 ↑ 1.0 1 906 / 3

Index Scan using insurance_remittance_pkey on insurance_remittance ir_1 (cost=0.42..8.16 rows=1 width=13) (actual time=0.002..0.002 rows=1 loops=906)

  • Index Cond: (remittance_id = ipu.remittance_id)
33. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using bill_charge_pkey on bill_charge bc (cost=0.56..5.24 rows=1 width=24) (never executed)

  • Index Cond: ((charge_id)::text = (ipa.charge_id)::text)
34. 239.826 356.536 ↑ 12.9 35,192 1

Gather (cost=1,022.41..668,673.41 rows=455,716 width=41) (actual time=2.787..356.536 rows=35,192 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
35. 10.532 116.710 ↑ 16.2 11,731 3 / 3

Nested Loop (cost=22.41..622,101.81 rows=189,882 width=41) (actual time=1.012..116.710 rows=11,731 loops=3)

36. 3.140 12.333 ↑ 16.2 11,731 3 / 3

Nested Loop (cost=21.85..22,954.22 rows=189,882 width=51) (actual time=1.000..12.333 rows=11,731 loops=3)

  • Join Filter: (ipu_1.remittance_id = ipa_1.remittance_id)
37. 0.452 2.755 ↑ 1.7 74 3 / 3

Merge Join (cost=21.28..4,566.98 rows=126 width=45) (actual time=0.993..2.755 rows=74 loops=3)

  • Merge Cond: (ir_2.remittance_id = ipu_1.remittance_id)
38. 2.047 2.047 ↑ 52.1 4,738 3 / 3

Parallel Index Scan using insurance_remittance_pkey on insurance_remittance ir_2 (cost=0.42..176,676.13 rows=246,936 width=13) (actual time=0.030..2.047 rows=4,738 loops=3)

39. 0.151 0.256 ↑ 1.0 302 3 / 3

Sort (cost=20.46..21.21 rows=302 width=32) (actual time=0.210..0.256 rows=302 loops=3)

  • Sort Key: ipu_1.remittance_id
  • Sort Method: quicksort Memory: 48kB
40. 0.105 0.105 ↑ 1.0 302 3 / 3

Seq Scan on insurance_payment_unalloc_amount ipu_1 (cost=0.00..8.02 rows=302 width=32) (actual time=0.020..0.105 rows=302 loops=3)

41. 6.438 6.438 ↑ 9.9 159 222 / 3

Index Scan using insurance_payment_allocation_remittance_id_index on insurance_payment_allocation ipa_1 (cost=0.56..126.34 rows=1,567 width=14) (actual time=0.007..0.087 rows=159 loops=222)

  • Index Cond: (remittance_id = ir_2.remittance_id)
42. 93.845 93.845 ↑ 1.0 1 35,192 / 3

Index Only Scan using bill_charge_pkey on bill_charge bc_1 (cost=0.56..3.16 rows=1 width=10) (actual time=0.008..0.008 rows=1 loops=35,192)

  • Index Cond: (charge_id = (ipa_1.charge_id)::text)
  • Heap Fetches: 760
43. 762.654 20,226.780 ↓ 65.3 57,345 1

Sort (cost=796,552.72..796,554.91 rows=878 width=365) (actual time=20,204.552..20,226.780 rows=57,345 loops=1)

  • Sort Key: b.bill_no
  • Sort Method: external sort Disk: 15472kB
44. 223.709 19,464.126 ↓ 64.9 56,942 1

Gather (cost=729,628.20..796,509.79 rows=878 width=365) (actual time=16,617.469..19,464.126 rows=56,942 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
45. 26.152 19,240.417 ↓ 51.9 18,981 3 / 3

Nested Loop Left Join (cost=728,628.20..795,421.99 rows=366 width=365) (actual time=16,577.415..19,240.417 rows=18,981 loops=3)

46. 29.304 19,081.400 ↓ 51.9 18,981 3 / 3

Nested Loop Left Join (cost=728,627.78..794,605.59 rows=366 width=366) (actual time=16,577.392..19,081.400 rows=18,981 loops=3)

47. 23.177 18,805.347 ↓ 51.9 18,981 3 / 3

Nested Loop Left Join (cost=728,627.35..793,713.83 rows=366 width=357) (actual time=16,577.351..18,805.347 rows=18,981 loops=3)

48. 24.298 18,592.363 ↓ 51.9 18,981 3 / 3

Nested Loop Left Join (cost=728,626.91..791,286.21 rows=366 width=343) (actual time=16,577.328..18,592.363 rows=18,981 loops=3)

49. 21.564 18,378.258 ↓ 51.9 18,981 3 / 3

Nested Loop Left Join (cost=728,626.48..788,858.58 rows=366 width=329) (actual time=16,577.308..18,378.258 rows=18,981 loops=3)

50. 18.522 18,091.450 ↓ 51.8 18,946 3 / 3

Hash Left Join (cost=728,626.05..786,428.21 rows=366 width=315) (actual time=16,577.271..18,091.450 rows=18,946 loops=3)

  • Hash Cond: ((pd.salutation)::text = (sm.salutation_id)::text)
51. 31.757 18,072.893 ↓ 51.8 18,946 3 / 3

Nested Loop Left Join (cost=728,624.58..786,425.59 rows=366 width=319) (actual time=16,577.215..18,072.893 rows=18,946 loops=3)

  • Join Filter: (pip.priority = 1)
  • Rows Removed by Join Filter: 17
52. 20.512 17,965.352 ↓ 51.8 18,946 3 / 3

Nested Loop Left Join (cost=728,624.14..785,550.04 rows=366 width=314) (actual time=16,577.187..17,965.352 rows=18,946 loops=3)

53. 8.737 17,698.767 ↓ 51.7 18,929 3 / 3

Hash Left Join (cost=728,623.71..784,676.17 rows=366 width=322) (actual time=16,577.156..17,698.767 rows=18,929 loops=3)

  • Hash Cond: ((pr.secondary_sponsor_id)::text = (stpa.tpa_id)::text)
54. 32.557 17,689.723 ↓ 51.7 18,929 3 / 3

Hash Join (cost=728,574.69..784,626.19 rows=366 width=297) (actual time=16,576.826..17,689.723 rows=18,929 loops=3)

  • Hash Cond: (pr.center_id = hcm.center_id)
55. 72.231 17,657.029 ↓ 4.9 82,805 3 / 3

Nested Loop Left Join (cost=728,564.10..784,567.33 rows=16,838 width=283) (actual time=16,136.138..17,657.029 rows=82,805 loops=3)

56. 114.981 16,425.533 ↓ 4.9 82,805 3 / 3

Merge Left Join (cost=728,563.67..746,032.54 rows=16,838 width=249) (actual time=16,136.090..16,425.533 rows=82,805 loops=3)

  • Merge Cond: ((b.visit_id)::text = (isr.incoming_visit_id)::text)
57. 44.829 16,248.774 ↓ 4.9 82,805 3 / 3

Merge Left Join (cost=728,563.25..728,648.85 rows=16,838 width=240) (actual time=16,136.029..16,248.774 rows=82,805 loops=3)

  • Merge Cond: ((b.visit_id)::text = (prc.customer_id)::text)
58. 983.005 16,203.905 ↓ 4.9 82,805 3 / 3

Sort (cost=728,539.07..728,581.16 rows=16,838 width=192) (actual time=16,135.983..16,203.905 rows=82,805 loops=3)

  • Sort Key: b.visit_id
  • Sort Method: external merge Disk: 17808kB
59. 67.576 15,220.900 ↓ 4.9 82,805 3 / 3

Hash Left Join (cost=115.53..727,357.09 rows=16,838 width=192) (actual time=735.268..15,220.900 rows=82,805 loops=3)

  • Hash Cond: ((pr.primary_sponsor_id)::text = (ptpa.tpa_id)::text)
60. 72.893 15,152.354 ↓ 4.9 82,805 3 / 3

Hash Left Join (cost=66.52..727,263.62 rows=16,838 width=177) (actual time=734.260..15,152.354 rows=82,805 loops=3)

  • Hash Cond: ((pr.org_id)::text = (od.org_id)::text)
61. 94.203 15,077.383 ↓ 4.9 82,805 3 / 3

Hash Left Join (cost=1.53..727,154.32 rows=16,838 width=163) (actual time=732.034..15,077.383 rows=82,805 loops=3)

  • Hash Cond: (pr.visit_type = vn.visit_type)
62. 197.474 14,983.104 ↓ 4.9 82,805 3 / 3

Nested Loop (cost=0.43..727,062.20 rows=16,838 width=161) (actual time=731.709..14,983.104 rows=82,805 loops=3)

63. 13,129.537 13,129.537 ↓ 4.9 82,805 3 / 3

Parallel Seq Scan on bill b (cost=0.00..607,014.66 rows=16,838 width=92) (actual time=731.489..13,129.537 rows=82,805 loops=3)

  • Filter: (is_tpa AND (status <> 'X'::bpchar) AND (date(open_date) >= '2020-03-01'::date) AND (date(open_date) <= '2020-03-31'::date))
  • Rows Removed by Filter: 3457172
64. 1,656.093 1,656.093 ↑ 1.0 1 248,414 / 3

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.43..7.13 rows=1 width=69) (actual time=0.020..0.020 rows=1 loops=248,414)

  • Index Cond: ((patient_id)::text = (b.visit_id)::text)
65. 0.023 0.076 ↑ 1.0 4 3 / 3

Hash (cost=1.04..1.04 rows=4 width=6) (actual time=0.076..0.076 rows=4 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
66. 0.053 0.053 ↑ 1.0 4 3 / 3

Seq Scan on visit_type_names vn (cost=0.00..1.04 rows=4 width=6) (actual time=0.050..0.053 rows=4 loops=3)

67. 1.095 2.078 ↑ 1.0 1,644 3 / 3

Hash (cost=44.44..44.44 rows=1,644 width=30) (actual time=2.078..2.078 rows=1,644 loops=3)

  • Buckets: 2048 Batches: 1 Memory Usage: 116kB
68. 0.983 0.983 ↑ 1.0 1,644 3 / 3

Seq Scan on organization_details od (cost=0.00..44.44 rows=1,644 width=30) (actual time=0.036..0.983 rows=1,644 loops=3)

69. 0.460 0.970 ↑ 1.0 712 3 / 3

Hash (cost=40.12..40.12 rows=712 width=35) (actual time=0.970..0.970 rows=712 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 55kB
70. 0.510 0.510 ↑ 1.0 712 3 / 3

Seq Scan on tpa_master ptpa (cost=0.00..40.12 rows=712 width=35) (actual time=0.035..0.510 rows=712 loops=3)

71. 0.015 0.040 ↓ 0.0 0 3 / 3

Sort (cost=24.18..24.88 rows=280 width=48) (actual time=0.040..0.040 rows=0 loops=3)

  • Sort Key: prc.customer_id
  • Sort Method: quicksort Memory: 25kB
72. 0.025 0.025 ↓ 0.0 0 3 / 3

Seq Scan on store_retail_customers prc (cost=0.00..12.80 rows=280 width=48) (actual time=0.025..0.025 rows=0 loops=3)

73. 61.778 61.778 ↓ 1.0 497,052 3 / 3

Index Only Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.42..16,090.82 rows=496,696 width=9) (actual time=0.056..61.778 rows=497,052 loops=3)

  • Heap Fetches: 6787
74. 1,159.265 1,159.265 ↑ 1.0 1 248,414 / 3

Index Scan using patient_details_pkey on patient_details pd (cost=0.43..2.29 rows=1 width=49) (actual time=0.014..0.014 rows=1 loops=248,414)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
75. 0.016 0.137 ↑ 1.0 1 3 / 3

Hash (cost=10.57..10.57 rows=1 width=22) (actual time=0.137..0.137 rows=1 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
76. 0.121 0.121 ↑ 1.0 1 3 / 3

Seq Scan on hospital_center_master hcm (cost=0.00..10.57 rows=1 width=22) (actual time=0.120..0.121 rows=1 loops=3)

  • Filter: ((center_name)::text = 'NMC Royal'::text)
  • Rows Removed by Filter: 45
77. 0.145 0.307 ↑ 1.0 712 3 / 3

Hash (cost=40.12..40.12 rows=712 width=35) (actual time=0.307..0.307 rows=712 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 55kB
78. 0.162 0.162 ↑ 1.0 712 3 / 3

Seq Scan on tpa_master stpa (cost=0.00..40.12 rows=712 width=35) (actual time=0.010..0.162 rows=712 loops=3)

79. 246.073 246.073 ↑ 1.0 1 56,786 / 3

Index Scan using patient_insurance_plans_patient_id on patient_insurance_plans pip (cost=0.43..2.38 rows=1 width=24) (actual time=0.012..0.013 rows=1 loops=56,786)

  • Index Cond: ((patient_id)::text = (pr.patient_id)::text)
80. 75.784 75.784 ↑ 1.0 1 56,838 / 3

Index Scan using patient_policy_details_patient_policy_id_key on patient_policy_details pppd (cost=0.43..2.38 rows=1 width=17) (actual time=0.004..0.004 rows=1 loops=56,838)

  • Index Cond: (patient_policy_id = pip.patient_policy_id)
81. 0.008 0.035 ↑ 1.0 21 3 / 3

Hash (cost=1.21..1.21 rows=21 width=14) (actual time=0.035..0.035 rows=21 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
82. 0.027 0.027 ↑ 1.0 21 3 / 3

Seq Scan on salutation_master sm (cost=0.00..1.21 rows=21 width=14) (actual time=0.024..0.027 rows=21 loops=3)

83. 265.244 265.244 ↑ 1.0 1 56,838 / 3

Index Scan using bill_claim_bill_no_idx on bill_claim bclm (cost=0.43..6.63 rows=1 width=28) (actual time=0.014..0.014 rows=1 loops=56,838)

  • Index Cond: ((bill_no)::text = (b.bill_no)::text)
84. 189.807 189.807 ↑ 1.0 1 56,942 / 3

Index Scan using bill_claim_bill_no_idx on bill_claim bclm1 (cost=0.43..6.63 rows=1 width=28) (actual time=0.010..0.010 rows=1 loops=56,942)

  • Index Cond: ((bill_no)::text = (b.bill_no)::text)
  • Filter: (priority = 1)
  • Rows Removed by Filter: 0
85. 189.807 189.807 ↓ 0.0 0 56,942 / 3

Index Scan using bill_claim_bill_no_idx on bill_claim bclm2 (cost=0.43..6.63 rows=1 width=28) (actual time=0.010..0.010 rows=0 loops=56,942)

  • Index Cond: ((bill_no)::text = (b.bill_no)::text)
  • Filter: (priority = 2)
  • Rows Removed by Filter: 1
86. 246.749 246.749 ↑ 1.0 1 56,942 / 3

Index Scan using insurance_claim_id_index on insurance_claim icl (cost=0.43..2.44 rows=1 width=23) (actual time=0.013..0.013 rows=1 loops=56,942)

  • Index Cond: ((claim_id)::text = (bclm.claim_id)::text)
87. 132.865 132.865 ↑ 1.0 1 56,942 / 3

Index Scan using insurance_submission_batch_pkey on insurance_submission_batch firstsub (cost=0.42..2.23 rows=1 width=17) (actual time=0.007..0.007 rows=1 loops=56,942)

  • Index Cond: ((submission_batch_id)::text = (icl.submission_batch_id)::text)
  • Filter: (is_resubmission = 'N'::bpchar)
88. 1,145.480 23,099.599 ↓ 1.4 1,373,759 1

GroupAggregate (cost=498,357.17..528,785.25 rows=961,205 width=46) (actual time=18,278.942..23,099.599 rows=1,373,759 loops=1)

  • Group Key: insurance_claim_resubmission.claim_id
89. 20,921.884 21,954.119 ↑ 1.0 2,740,689 1

Sort (cost=498,357.17..505,295.85 rows=2,775,470 width=23) (actual time=18,278.919..21,954.119 rows=2,740,689 loops=1)

  • Sort Key: insurance_claim_resubmission.claim_id
  • Sort Method: external merge Disk: 91968kB
90. 1,032.235 1,032.235 ↑ 1.0 2,775,287 1

Seq Scan on insurance_claim_resubmission (cost=0.00..144,401.70 rows=2,775,470 width=23) (actual time=0.030..1,032.235 rows=2,775,287 loops=1)

91. 0.000 0.000 ↓ 0.0 0 57,345

Index Scan using insurance_submission_batch_pkey on insurance_submission_batch resub (cost=0.42..2.25 rows=1 width=17) (actual time=0.000..0.000 rows=0 loops=57,345)

  • Index Cond: ((submission_batch_id)::text = (max((insurance_claim_resubmission.resubmission_batch_id)::text)))
Planning time : 108.083 ms
Execution time : 837,295.487 ms