explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Zc4P

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

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

2. 0.638 6,022.179 ↓ 18.0 18 1

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

3. 0.047 6,021.109 ↓ 18.0 18 1

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

4. 0.085 6,020.918 ↓ 18.0 18 1

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

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

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

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

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

7. 0.781 5,966.578 ↓ 18.0 18 1

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

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

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

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

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

10. 0.035 5,964.777 ↓ 18.0 18 1

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

  • Join Filter: ((resub.claim_id)::text = (ic.claim_id)::text)
11. 2.226 5,961.790 ↓ 18.0 18 1

Nested Loop Left Join (cost=1.99..344,964.13 rows=1 width=335) (actual time=2,129.961..5,961.790 rows=18 loops=1)

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

Nested Loop Left Join (cost=1.99..344,758.14 rows=1 width=321) (actual time=2,129.643..5,957.260 rows=18 loops=1)

  • Join Filter: (cat.category_id = pip.plan_type_id)
  • Rows Removed by Join Filter: 89,465
13. 0.077 5,945.348 ↓ 18.0 18 1

Nested Loop Left Join (cost=1.99..344,244.99 rows=1 width=295) (actual time=2,128.910..5,945.348 rows=18 loops=1)

  • Join Filter: ((sal.salutation_id)::text = (pd.salutation)::text)
  • Rows Removed by Join Filter: 33
14. 0.047 5,945.235 ↓ 18.0 18 1

Nested Loop (cost=1.99..344,243.52 rows=1 width=299) (actual time=2,128.901..5,945.235 rows=18 loops=1)

15. 0.000 5,944.954 ↓ 18.0 18 1

Nested Loop (cost=1.56..344,240.65 rows=1 width=246) (actual time=2,128.882..5,944.954 rows=18 loops=1)

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

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

17. 5.783 5,761.078 ↓ 9,487.0 9,487 1

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

18. 5,628.395 5,628.395 ↓ 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,128.809..5,628.395 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.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.001..0.002 rows=3 loops=18)

24. 5.994 5.994 ↑ 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.333 rows=4,971 loops=18)

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

26. 0.018 2.952 ↓ 0.0 0 18

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

  • Group Key: resub.claim_id
27. 0.008 2.934 ↓ 0.0 0 18

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

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

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

29. 0.200 0.200 ↑ 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.020..0.200 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.162 0.162 ↑ 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.009..0.009 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.270 0.270 ↑ 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.009..0.015 rows=5 loops=18)

  • Index Cond: ((resubmission_batch_id)::text = (isb.submission_batch_id)::text)
33. 0.468 0.468 ↑ 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.026 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.166 23.166 ↑ 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.287 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.144 0.144 ↑ 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.008..0.008 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.414 ↑ 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.023 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.054 0.360 ↓ 0.0 0 18

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

40. 0.234 0.234 ↑ 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.013..0.013 rows=2 loops=18)

  • Index Cond: ((claim_id)::text = (cr.claim_id)::text)
41. 0.072 0.072 ↑ 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.004..0.004 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 : 21.268 ms
Execution time : 6,022.506 ms