explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kAQe

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 6,285.377 ↓ 18.0 18 1

Limit (cost=5,497.54..353,333.90 rows=1 width=844) (actual time=2,192.755..6,285.377 rows=18 loops=1)

2. 3.656 6,285.367 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,497.54..353,333.89 rows=1 width=844) (actual time=2,192.753..6,285.367 rows=18 loops=1)

3. 0.045 6,281.081 ↓ 18.0 18 1

Nested Loop (cost=5,486.65..353,318.41 rows=1 width=603) (actual time=2,189.698..6,281.081 rows=18 loops=1)

4. 0.088 6,280.802 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,486.23..353,309.95 rows=1 width=595) (actual time=2,189.652..6,280.802 rows=18 loops=1)

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

Nested Loop Left Join (cost=5,486.23..353,308.84 rows=1 width=579) (actual time=2,189.639..6,280.696 rows=18 loops=1)

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

Nested Loop Left Join (cost=5,486.23..350,510.07 rows=1 width=535) (actual time=2,180.120..6,220.192 rows=18 loops=1)

7. 0.860 6,219.995 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,485.95..350,509.76 rows=1 width=510) (actual time=2,180.053..6,219.995 rows=18 loops=1)

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

Nested Loop Left Join (cost=5,485.95..350,476.91 rows=1 width=485) (actual time=2,179.786..6,218.559 rows=18 loops=1)

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

Nested Loop Left Join (cost=5,485.52..350,455.73 rows=1 width=479) (actual time=2,179.632..6,217.900 rows=18 loops=1)

10. 0.039 6,217.498 ↓ 18.0 18 1

Nested Loop Left Join (cost=5,485.10..350,447.29 rows=1 width=367) (actual time=2,179.554..6,217.498 rows=18 loops=1)

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

Nested Loop Left Join (cost=1.99..344,964.13 rows=1 width=335) (actual time=2,170.703..6,208.603 rows=18 loops=1)

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

Nested Loop Left Join (cost=1.99..344,758.14 rows=1 width=321) (actual time=2,170.148..6,203.777 rows=18 loops=1)

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

Nested Loop Left Join (cost=1.99..344,244.99 rows=1 width=295) (actual time=2,168.893..6,191.108 rows=18 loops=1)

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

Nested Loop (cost=1.99..344,243.52 rows=1 width=299) (actual time=2,168.883..6,190.998 rows=18 loops=1)

15. 4.204 6,190.595 ↓ 18.0 18 1

Nested Loop (cost=1.56..344,240.65 rows=1 width=246) (actual time=2,168.834..6,190.595 rows=18 loops=1)

  • Join Filter: ((ic.patient_id)::text = (pr.patient_id)::text)
16. 8.501 6,063.099 ↓ 9,484.0 9,484 1

Nested Loop (cost=1.00..344,238.95 rows=1 width=215) (actual time=2,168.788..6,063.099 rows=9,484 loops=1)

17. 6.926 5,931.267 ↓ 9,487.0 9,487 1

Nested Loop (cost=0.56..344,237.06 rows=1 width=177) (actual time=2,168.753..5,931.267 rows=9,487 loops=1)

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

Seq Scan on claim_reconciliation cr (cost=0.00..344,211.32 rows=3 width=73) (actual time=2,168.679..5,755.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. 169.200 169.200 ↑ 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.012..0.012 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. 123.331 123.331 ↑ 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.013..0.013 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. 123.292 123.292 ↓ 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.013..0.013 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.360 0.360 ↑ 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.020..0.020 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.003..0.350 rows=4,971 loops=18)

25. 2.394 2.394 ↑ 2.0 1,097 18

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

26. 0.000 8.856 ↓ 0.0 0 18

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

  • Group Key: resub.claim_id
27. 0.042 8.856 ↓ 0.0 0 18

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

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

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

29. 0.835 0.835 ↑ 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.060..0.835 rows=694 loops=1)

  • Index Cond: ((category_type)::text = 'RECON'::text)
30. 7.634 7.634 ↓ 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.011..0.011 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.342 0.342 ↑ 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.019..0.019 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.594 0.594 ↑ 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.017..0.033 rows=5 loops=18)

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

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

34. 0.144 0.144 ↑ 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.008..0.008 rows=1 loops=18)

  • Index Cond: (((tpa_id)::text = (pip.sponsor_id)::text) AND ((tpa_id)::text = 'TPAID0048'::text))
35. 26.280 26.280 ↑ 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.002..1.460 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.234 0.234 ↑ 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.013..0.013 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.090 0.612 ↑ 1.0 1 18

Bitmap Heap Scan on insurance_claim_remittance icr (cost=10.89..14.91 rows=1 width=28) (actual time=0.034..0.034 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.522 ↓ 0.0 0 18

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

40. 0.360 0.360 ↑ 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.020..0.020 rows=2 loops=18)

  • Index Cond: ((claim_id)::text = (cr.claim_id)::text)
41. 0.126 0.126 ↑ 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.007..0.007 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 : 410.670 ms
Execution time : 6,287.636 ms