explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fGSu

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 6,121.757 ↓ 18.0 18 1

Limit (cost=5,497.54..353,327.42 rows=1 width=844) (actual time=2,179.209..6,121.757 rows=18 loops=1)

2. 0.676 6,121.745 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,497.54..353,327.41 rows=1 width=844) (actual time=2,179.207..6,121.745 rows=18 loops=1)

3. 0.056 6,120.619 ↓ 18.0 18 1

Nested Loop (cost=5,486.65..353,311.93 rows=1 width=603) (actual time=2,179.085..6,120.619 rows=18 loops=1)

4. 0.084 6,120.401 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,486.23..353,303.47 rows=1 width=595) (actual time=2,179.056..6,120.401 rows=18 loops=1)

  • Join Filter: (otn.op_type = pr.op_type)
  • Rows Removed by Join Filter: 15
5. 31.906 6,120.299 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,486.23..353,302.36 rows=1 width=579) (actual time=2,179.048..6,120.299 rows=18 loops=1)

  • Join Filter: (ipm.plan_id = pip.plan_id)
  • Rows Removed by Join Filter: 358,540
6. 0.052 6,064.561 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,486.23..350,503.59 rows=1 width=535) (actual time=2,175.119..6,064.561 rows=18 loops=1)

7. 0.826 6,064.419 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,485.95..350,503.29 rows=1 width=510) (actual time=2,175.105..6,064.419 rows=18 loops=1)

  • Join Filter: ((icm.insurance_co_id)::text = (pip.insurance_co)::text)
  • Rows Removed by Join Filter: 7,344
8. 0.054 6,063.089 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,485.95..350,470.43 rows=1 width=485) (actual time=2,175.016..6,063.089 rows=18 loops=1)

  • Join Filter: ((cr.claim_id)::text = (icrsub.claim_id)::text)
  • Rows Removed by Join Filter: 78
9. 0.061 6,062.729 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,485.52..350,449.25 rows=1 width=479) (actual time=2,174.987..6,062.729 rows=18 loops=1)

10. 0.031 6,062.488 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,485.10..350,440.81 rows=1 width=367) (actual time=2,174.963..6,062.488 rows=18 loops=1)

  • Join Filter: ((resub.claim_id)::text = (ic.claim_id)::text)
11. 2.283 6,059.469 ↓ 18.0 18 1

Nested Loop Left Join (cost=1.99..344,957.65 rows=1 width=335) (actual time=2,171.992..6,059.469 rows=18 loops=1)

  • Join Filter: ((doc.doctor_id)::text = (pr.doctor)::text)
  • Rows Removed by Join Filter: 19,730
12. 6.253 6,054.846 ↓ 18.0 18 1

Nested Loop Left Join (cost=1.99..344,751.66 rows=1 width=321) (actual time=2,171.676..6,054.846 rows=18 loops=1)

  • Join Filter: (cat.category_id = pip.plan_type_id)
  • Rows Removed by Join Filter: 89,465
13. 0.084 6,042.293 ↓ 18.0 18 1

Nested Loop Left Join (cost=1.99..344,238.51 rows=1 width=295) (actual time=2,170.889..6,042.293 rows=18 loops=1)

  • Join Filter: ((sal.salutation_id)::text = (pd.salutation)::text)
  • Rows Removed by Join Filter: 33
14. 0.044 6,042.173 ↓ 18.0 18 1

Nested Loop (cost=1.99..344,237.04 rows=1 width=299) (actual time=2,170.881..6,042.173 rows=18 loops=1)

15. 0.331 6,041.877 ↓ 18.0 18 1

Nested Loop (cost=1.56..344,234.17 rows=1 width=246) (actual time=2,170.858..6,041.877 rows=18 loops=1)

  • Join Filter: ((ic.patient_id)::text = (pr.patient_id)::text)
16. 6.523 5,946.706 ↓ 9,484.0 9,484 1

Nested Loop (cost=1.00..344,232.47 rows=1 width=215) (actual time=2,170.820..5,946.706 rows=9,484 loops=1)

17. 8.759 5,854.800 ↓ 9,487.0 9,487 1

Nested Loop (cost=0.56..344,230.58 rows=1 width=177) (actual time=2,170.794..5,854.800 rows=9,487 loops=1)

18. 5,719.141 5,719.141 ↓ 4,700.0 14,100 1

Seq Scan on claim_reconciliation cr (cost=0.00..344,204.84 rows=3 width=73) (actual time=2,170.748..5,719.141 rows=14,100 loops=1)

  • Filter: ((payment_ref_all ~~* '%290440%'::text) AND ((last_bill_open_date)::date >= '2019-01-01'::date) AND ((last_bill_open_date)::date <= '2020-08-27'::date))
  • Rows Removed by Filter: 8,778,981
19. 126.900 126.900 ↑ 1.0 1 14,100

Index Scan using insurance_claim_id_index on insurance_claim ic (cost=0.56..8.58 rows=1 width=104) (actual time=0.009..0.009 rows=1 loops=14,100)

  • Index Cond: ((claim_id)::text = (cr.claim_id)::text)
  • Filter: (status = ANY ('{D,R}'::bpchar[]))
  • Rows Removed by Filter: 0
20. 85.383 85.383 ↑ 1.0 1 9,487

Index Scan using patient_insurance_plans_patient_id on patient_insurance_plans pip (cost=0.43..1.88 rows=1 width=42) (actual time=0.009..0.009 rows=1 loops=9,487)

  • Index Cond: ((patient_id)::text = (ic.patient_id)::text)
  • Filter: (((sponsor_id)::text = 'TPAID0048'::text) AND (ic.plan_id = plan_id))
  • Rows Removed by Filter: 0
21. 94.840 94.840 ↓ 0.0 0 9,484

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.56..1.68 rows=1 width=47) (actual time=0.010..0.010 rows=0 loops=9,484)

  • Index Cond: ((patient_id)::text = (pip.patient_id)::text)
  • Filter: (center_id = 2)
  • Rows Removed by Filter: 1
22. 0.252 0.252 ↑ 1.0 1 18

Index Scan using patient_details_pkey on patient_details pd (cost=0.43..2.87 rows=1 width=68) (actual time=0.014..0.014 rows=1 loops=18)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
23. 0.036 0.036 ↑ 7.0 3 18

Seq Scan on salutation_master sal (cost=0.00..1.21 rows=21 width=14) (actual time=0.002..0.002 rows=3 loops=18)

24. 6.300 6.300 ↑ 2.6 4,971 18

Seq Scan on insurance_category_master cat (cost=0.00..348.62 rows=13,162 width=26) (actual time=0.002..0.350 rows=4,971 loops=18)

25. 2.340 2.340 ↑ 2.0 1,097 18

Seq Scan on doctors doc (cost=0.00..178.22 rows=2,222 width=30) (actual time=0.005..0.130 rows=1,097 loops=18)

26. 0.018 2.988 ↓ 0.0 0 18

GroupAggregate (cost=5,483.11..5,483.13 rows=1 width=46) (actual time=0.166..0.166 rows=0 loops=18)

  • Group Key: resub.claim_id
27. 0.024 2.970 ↓ 0.0 0 18

Sort (cost=5,483.11..5,483.12 rows=1 width=23) (actual time=0.165..0.165 rows=0 loops=18)

  • Sort Key: resub.claim_id
  • Sort Method: quicksort Memory: 25kB
28. 0.000 2.946 ↓ 0.0 0 1

Nested Loop (cost=0.85..5,483.10 rows=1 width=23) (actual time=2.946..2.946 rows=0 loops=1)

29. 0.208 0.208 ↑ 1.0 694 1

Index Scan using idx_insurance_claim_resubmission_category_type on insurance_claim_resubmission resub (cost=0.43..92.17 rows=728 width=23) (actual time=0.024..0.208 rows=694 loops=1)

  • Index Cond: ((category_type)::text = 'RECON'::text)
30. 2.776 2.776 ↓ 0.0 0 694

Index Scan using insurance_submission_batch_pkey on insurance_submission_batch isb_1 (cost=0.42..7.40 rows=1 width=9) (actual time=0.004..0.004 rows=0 loops=694)

  • Index Cond: ((submission_batch_id)::text = (resub.resubmission_batch_id)::text)
  • Filter: ((is_reconciliation = 'Y'::bpchar) AND (status = 'O'::bpchar))
  • Rows Removed by Filter: 1
31. 0.180 0.180 ↑ 1.0 1 18

Index Scan using insurance_submission_batch_pkey on insurance_submission_batch isb (cost=0.42..8.44 rows=1 width=121) (actual time=0.010..0.010 rows=1 loops=18)

  • Index Cond: ((submission_batch_id)::text = COALESCE((max((isb_1.submission_batch_id)::text)), (cr.latest_resubmission_id)::text))
32. 0.306 0.306 ↑ 20.2 5 18

Index Scan using insurance_claim_resubmission_batch_id_index on insurance_claim_resubmission icrsub (cost=0.43..19.92 rows=101 width=29) (actual time=0.011..0.017 rows=5 loops=18)

  • Index Cond: ((resubmission_batch_id)::text = (isb.submission_batch_id)::text)
33. 0.504 0.504 ↑ 2.0 409 18

Seq Scan on insurance_company_master icm (cost=0.00..22.38 rows=838 width=33) (actual time=0.002..0.028 rows=409 loops=18)

34. 0.090 0.090 ↑ 1.0 1 18

Index Scan using tpa_master_pkey on tpa_master tpa (cost=0.28..0.30 rows=1 width=35) (actual time=0.005..0.005 rows=1 loops=18)

  • Index Cond: (((tpa_id)::text = (pip.sponsor_id)::text) AND ((tpa_id)::text = 'TPAID0048'::text))
35. 23.832 23.832 ↑ 2.8 19,920 18

Seq Scan on insurance_plan_main ipm (cost=0.00..2,097.23 rows=56,123 width=48) (actual time=0.001..1.324 rows=19,920 loops=18)

36. 0.018 0.018 ↑ 2.5 2 18

Seq Scan on op_type_names otn (cost=0.00..1.05 rows=5 width=20) (actual time=0.001..0.001 rows=2 loops=18)

37. 0.162 0.162 ↑ 1.0 1 18

Index Scan using insurance_remittance_pkey on insurance_remittance ir (cost=0.42..8.45 rows=1 width=12) (actual time=0.009..0.009 rows=1 loops=18)

  • Index Cond: (remittance_id = cr.latest_remittance_id)
  • Filter: (((transaction_date)::date >= '2020-07-23'::date) AND ((transaction_date)::date <= '2020-07-23'::date))
38. 0.054 0.432 ↑ 1.0 1 18

Bitmap Heap Scan on insurance_claim_remittance icr (cost=10.89..14.91 rows=1 width=28) (actual time=0.023..0.024 rows=1 loops=18)

  • Recheck Cond: (((claim_id)::text = (cr.claim_id)::text) AND (cr.latest_remittance_id = remittance_id))
  • Heap Blocks: exact=18
39. 0.036 0.378 ↓ 0.0 0 18

BitmapAnd (cost=10.89..10.89 rows=1 width=0) (actual time=0.021..0.021 rows=0 loops=18)

40. 0.252 0.252 ↑ 1.5 2 18

Bitmap Index Scan on insurance_claim_remittance_claim_id (cost=0.00..4.46 rows=3 width=0) (actual time=0.014..0.014 rows=2 loops=18)

  • Index Cond: ((claim_id)::text = (cr.claim_id)::text)
41. 0.090 0.090 ↑ 116.5 2 18

Bitmap Index Scan on insurance_claim_remittance_remittance_id (cost=0.00..6.18 rows=233 width=0) (actual time=0.005..0.005 rows=2 loops=18)

  • Index Cond: (cr.latest_remittance_id = remittance_id)
42.          

SubPlan (for Nested Loop Left Join)

43. 0.018 0.018 ↑ 1.0 1 18

Result (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=18)

Planning time : 23.871 ms
Execution time : 6,122.198 ms