explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yo9Y

Settings
# exclusive inclusive rows x rows loops node
1. 4.992 5,890.305 ↓ 195.0 195 1

Nested Loop Left Join (cost=24.76..242,773.76 rows=1 width=848) (actual time=3,314.221..5,890.305 rows=195 loops=1)

2. 0.603 5,882.583 ↓ 195.0 195 1

Nested Loop (cost=24.32..242,760.74 rows=1 width=607) (actual time=3,314.094..5,882.583 rows=195 loops=1)

3. 1.140 5,879.810 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.90..242,752.28 rows=1 width=599) (actual time=1,588.742..5,879.810 rows=434 loops=1)

4. 383.977 5,877.368 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.77..242,752.12 rows=1 width=584) (actual time=1,588.727..5,877.368 rows=434 loops=1)

  • Join Filter: (ipm.plan_id = pip.plan_id)
  • Rows Removed by Join Filter: 5,432,112
5. 0.573 4,974.761 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.77..240,420.41 rows=1 width=541) (actual time=1,587.593..4,974.761 rows=434 loops=1)

6. 15.958 4,972.018 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.50..240,420.11 rows=1 width=517) (actual time=1,587.576..4,972.018 rows=434 loops=1)

  • Join Filter: ((icm.insurance_co_id)::text = (pip.insurance_co)::text)
  • Rows Removed by Join Filter: 182,714
7. 0.992 4,941.738 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.50..240,391.86 rows=1 width=493) (actual time=1,587.480..4,941.738 rows=434 loops=1)

  • Join Filter: ((cr.claim_id)::text = (icrsub.claim_id)::text)
  • Rows Removed by Join Filter: 2,585
8. 0.790 4,935.104 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.07..240,386.55 rows=1 width=487) (actual time=1,587.464..4,935.104 rows=434 loops=1)

9. 0.821 4,930.842 ↓ 434.0 434 1

Nested Loop Left Join (cost=22.65..240,378.12 rows=1 width=367) (actual time=1,587.445..4,930.842 rows=434 loops=1)

  • Join Filter: ((resub.claim_id)::text = (ic.claim_id)::text)
  • Rows Removed by Join Filter: 434
10. 45.680 4,929.153 ↓ 434.0 434 1

Nested Loop Left Join (cost=1.73..240,357.15 rows=1 width=335) (actual time=1,587.343..4,929.153 rows=434 loops=1)

  • Join Filter: ((doc.doctor_id)::text = (pr.doctor)::text)
  • Rows Removed by Join Filter: 517,197
11. 92.290 4,837.035 ↓ 434.0 434 1

Nested Loop Left Join (cost=1.73..240,263.93 rows=1 width=321) (actual time=1,587.102..4,837.035 rows=434 loops=1)

  • Join Filter: (cat.category_id = pip.plan_type_id)
  • Rows Removed by Join Filter: 1,324,118
12. 1.688 4,624.961 ↓ 434.0 434 1

Nested Loop Left Join (cost=1.73..239,837.36 rows=1 width=295) (actual time=1,586.482..4,624.961 rows=434 loops=1)

  • Join Filter: ((sal.salutation_id)::text = (pd.salutation)::text)
  • Rows Removed by Join Filter: 697
13. 1.015 4,622.839 ↓ 434.0 434 1

Nested Loop (cost=1.73..239,835.89 rows=1 width=299) (actual time=1,586.472..4,622.839 rows=434 loops=1)

14. 0.711 4,616.182 ↓ 434.0 434 1

Nested Loop (cost=1.30..239,835.06 rows=1 width=246) (actual time=1,586.450..4,616.182 rows=434 loops=1)

  • Join Filter: ((ic.patient_id)::text = (pr.patient_id)::text)
15. 0.374 4,609.829 ↓ 434.0 434 1

Nested Loop (cost=0.86..239,833.92 rows=1 width=215) (actual time=1,586.422..4,609.829 rows=434 loops=1)

16. 0.796 4,603.379 ↓ 434.0 434 1

Nested Loop (cost=0.43..239,832.40 rows=1 width=177) (actual time=1,586.396..4,603.379 rows=434 loops=1)

17. 4,583.903 4,583.903 ↓ 934.0 1,868 1

Seq Scan on claim_reconciliation cr (cost=0.00..239,815.49 rows=2 width=73) (actual time=1,586.344..4,583.903 rows=1,868 loops=1)

  • Filter: ((payment_ref_all ~~* '%50491720%'::text) AND ((last_bill_open_date)::date >= '2016-01-01'::date) AND ((last_bill_open_date)::date <= '2020-08-27'::date))
  • Rows Removed by Filter: 6,263,754
18. 18.680 18.680 ↓ 0.0 0 1,868

Index Scan using insurance_claim_id_index on insurance_claim ic (cost=0.43..8.45 rows=1 width=104) (actual time=0.010..0.010 rows=0 loops=1,868)

  • Index Cond: ((claim_id)::text = (cr.claim_id)::text)
  • Filter: (status = ANY ('{D,R}'::bpchar[]))
  • Rows Removed by Filter: 1
19. 6.076 6.076 ↑ 1.0 1 434

Index Scan using patient_insurance_plans_patient_id on patient_insurance_plans pip (cost=0.43..1.51 rows=1 width=42) (actual time=0.013..0.014 rows=1 loops=434)

  • 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
20. 5.642 5.642 ↑ 1.0 1 434

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.43..1.13 rows=1 width=47) (actual time=0.013..0.013 rows=1 loops=434)

  • Index Cond: ((patient_id)::text = (pip.patient_id)::text)
  • Filter: (center_id = 9)
21. 5.642 5.642 ↑ 1.0 1 434

Index Scan using patient_details_pkey on patient_details pd (cost=0.43..0.83 rows=1 width=68) (actual time=0.013..0.013 rows=1 loops=434)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
22. 0.434 0.434 ↑ 7.0 3 434

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

23. 119.784 119.784 ↑ 3.5 3,052 434

Seq Scan on insurance_category_master cat (cost=0.00..294.03 rows=10,603 width=26) (actual time=0.001..0.276 rows=3,052 loops=434)

24. 46.438 46.438 ↑ 1.6 1,193 434

Seq Scan on doctors doc (cost=0.00..69.21 rows=1,921 width=30) (actual time=0.001..0.107 rows=1,193 loops=434)

25. 0.434 0.868 ↑ 1.0 1 434

GroupAggregate (cost=20.92..20.94 rows=1 width=46) (actual time=0.002..0.002 rows=1 loops=434)

  • Group Key: resub.claim_id
26. 0.367 0.434 ↑ 1.0 1 434

Sort (cost=20.92..20.93 rows=1 width=23) (actual time=0.001..0.001 rows=1 loops=434)

  • Sort Key: resub.claim_id
  • Sort Method: quicksort Memory: 25kB
27. 0.012 0.067 ↑ 1.0 1 1

Nested Loop (cost=0.85..20.91 rows=1 width=23) (actual time=0.042..0.067 rows=1 loops=1)

28. 0.019 0.019 ↓ 6.0 6 1

Index Scan using idx_insurance_claim_resubmission_category_type on insurance_claim_resubmission resub (cost=0.43..4.45 rows=1 width=23) (actual time=0.017..0.019 rows=6 loops=1)

  • Index Cond: ((category_type)::text = 'RECON'::text)
29. 0.036 0.036 ↓ 0.0 0 6

Index Scan using insurance_submission_batch_pkey on insurance_submission_batch isb_1 (cost=0.42..8.44 rows=1 width=9) (actual time=0.006..0.006 rows=0 loops=6)

  • 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
30. 3.472 3.472 ↑ 1.0 1 434

Index Scan using insurance_submission_batch_pkey on insurance_submission_batch isb (cost=0.42..8.44 rows=1 width=129) (actual time=0.008..0.008 rows=1 loops=434)

  • Index Cond: ((submission_batch_id)::text = COALESCE((max((isb_1.submission_batch_id)::text)), (cr.latest_resubmission_id)::text))
31. 5.642 5.642 ↑ 15.7 6 434

Index Scan using insurance_claim_resubmission_batch_id_index on insurance_claim_resubmission icrsub (cost=0.43..4.13 rows=94 width=29) (actual time=0.007..0.013 rows=6 loops=434)

  • Index Cond: ((resubmission_batch_id)::text = (isb.submission_batch_id)::text)
32. 14.322 14.322 ↑ 1.7 422 434

Seq Scan on insurance_company_master icm (cost=0.00..19.22 rows=722 width=32) (actual time=0.002..0.033 rows=422 loops=434)

33. 2.170 2.170 ↑ 1.0 1 434

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

  • Index Cond: (((tpa_id)::text = (pip.sponsor_id)::text) AND ((tpa_id)::text = 'TPAID0048'::text))
34. 518.630 518.630 ↑ 3.7 12,517 434

Seq Scan on insurance_plan_main ipm (cost=0.00..1,755.76 rows=46,076 width=47) (actual time=0.002..1.195 rows=12,517 loops=434)

35. 1.302 1.302 ↑ 1.0 1 434

Index Scan using op_type_names_pkey on op_type_names otn (cost=0.13..0.15 rows=1 width=19) (actual time=0.003..0.003 rows=1 loops=434)

  • Index Cond: (op_type = pr.op_type)
36. 2.170 2.170 ↓ 0.0 0 434

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

  • Index Cond: (remittance_id = cr.latest_remittance_id)
  • Filter: (((transaction_date)::date >= '2019-09-30'::date) AND ((transaction_date)::date <= '2020-07-23'::date))
  • Rows Removed by Filter: 1
37. 2.535 2.535 ↑ 1.0 1 195

Index Scan using insurance_claim_remittance_claim_id on insurance_claim_remittance icr (cost=0.43..12.45 rows=1 width=28) (actual time=0.013..0.013 rows=1 loops=195)

  • Index Cond: ((claim_id)::text = (cr.claim_id)::text)
  • Filter: (cr.latest_remittance_id = remittance_id)
  • Rows Removed by Filter: 0
38.          

SubPlan (for Nested Loop Left Join)

39. 0.195 0.195 ↑ 1.0 1 195

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

Planning time : 16.220 ms
Execution time : 5,890.916 ms