explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aK2o

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

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

2. 0.668 6,124.515 ↓ 18.0 18 1

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

3. 0.040 6,123.397 ↓ 18.0 18 1

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

4. 0.088 6,123.195 ↓ 18.0 18 1

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

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

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

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

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

7. 0.798 6,065.210 ↓ 18.0 18 1

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

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

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

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

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

10. 0.042 6,063.192 ↓ 18.0 18 1

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

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

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

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

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

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

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

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

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

15. 4.597 6,035.099 ↓ 18.0 18 1

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

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

Nested Loop (cost=1.00..344,238.95 rows=1 width=215) (actual time=2,154.127..5,935.662 rows=9,484 loops=1)

17. 9.962 5,840.258 ↓ 9,487.0 9,487 1

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

18. 5,703.396 5,703.396 ↓ 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,154.045..5,703.396 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. 94.870 94.870 ↑ 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.010 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.234 0.234 ↑ 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.013..0.013 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.912 6.912 ↑ 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.384 rows=4,971 loops=18)

25. 2.574 2.574 ↑ 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.143 rows=1,097 loops=18)

26. 0.000 8.946 ↓ 0.0 0 18

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

  • Group Key: resub.claim_id
27. 0.053 8.946 ↓ 0.0 0 18

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

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

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

29. 0.491 0.491 ↑ 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.057..0.491 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.198 0.198 ↑ 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.011..0.011 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.324 0.324 ↑ 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.018 rows=5 loops=18)

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

Seq Scan on insurance_company_master icm (cost=0.00..22.38 rows=838 width=33) (actual time=0.007..0.033 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. 25.416 25.416 ↑ 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.412 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.024..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.018 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.270 0.270 ↑ 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.015..0.015 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 : 30.626 ms
Execution time : 6,125.014 ms