explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aH3x

Settings
# exclusive inclusive rows x rows loops node
1. 5.647 6,551.253 ↓ 195.0 195 1

Nested Loop Left Join (cost=24.76..242,773.16 rows=1 width=1,061) (actual time=3,562.792..6,551.253 rows=195 loops=1)

2. 0.396 6,522.206 ↓ 195.0 195 1

Nested Loop (cost=24.32..242,760.13 rows=1 width=820) (actual time=3,562.058..6,522.206 rows=195 loops=1)

3. 1.110 6,517.470 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.90..242,751.67 rows=1 width=812) (actual time=1,690.865..6,517.470 rows=434 loops=1)

4. 377.811 6,514.624 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.77..242,751.51 rows=1 width=696) (actual time=1,690.523..6,514.624 rows=434 loops=1)

  • Join Filter: (ipm.plan_id = pip.plan_id)
  • Rows Removed by Join Filter: 5,432,541
5. 0.625 5,604.729 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.77..240,419.02 rows=1 width=653) (actual time=1,689.390..5,604.729 rows=434 loops=1)

6. 15.863 5,601.934 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.50..240,418.71 rows=1 width=629) (actual time=1,689.378..5,601.934 rows=434 loops=1)

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

Nested Loop Left Join (cost=23.50..240,390.47 rows=1 width=605) (actual time=1,689.295..5,571.315 rows=434 loops=1)

  • Join Filter: ((cr.claim_id)::text = (icrsub.claim_id)::text)
  • Rows Removed by Join Filter: 2,585
8. 1.124 5,556.443 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.07..240,385.19 rows=1 width=599) (actual time=1,688.728..5,556.443 rows=434 loops=1)

9. 1.061 5,547.507 ↓ 434.0 434 1

Nested Loop Left Join (cost=22.65..240,376.75 rows=1 width=480) (actual time=1,688.129..5,547.507 rows=434 loops=1)

  • Join Filter: ((resub.claim_id)::text = (ic.claim_id)::text)
  • Rows Removed by Join Filter: 434
10. 47.008 5,545.578 ↓ 434.0 434 1

Nested Loop Left Join (cost=1.73..240,355.79 rows=1 width=448) (actual time=1,688.036..5,545.578 rows=434 loops=1)

  • Join Filter: ((doc.doctor_id)::text = (pr.doctor)::text)
  • Rows Removed by Join Filter: 517,206
11. 91.483 5,444.754 ↓ 434.0 434 1

Nested Loop Left Join (cost=1.73..240,262.59 rows=1 width=434) (actual time=1,687.760..5,444.754 rows=434 loops=1)

  • Join Filter: (cat.category_id = pip.plan_type_id)
  • Rows Removed by Join Filter: 1,324,118
12. 0.989 5,231.751 ↓ 434.0 434 1

Nested Loop Left Join (cost=1.73..239,836.02 rows=1 width=408) (actual time=1,687.193..5,231.751 rows=434 loops=1)

  • Join Filter: ((sal.salutation_id)::text = (pd.salutation)::text)
  • Rows Removed by Join Filter: 697
13. 1.209 5,229.894 ↓ 434.0 434 1

Nested Loop (cost=1.73..239,834.55 rows=1 width=299) (actual time=1,687.184..5,229.894 rows=434 loops=1)

14. 0.744 5,093.277 ↓ 434.0 434 1

Nested Loop (cost=1.30..239,833.71 rows=1 width=246) (actual time=1,686.583..5,093.277 rows=434 loops=1)

  • Join Filter: ((ic.patient_id)::text = (pr.patient_id)::text)
15. 0.432 5,050.869 ↓ 434.0 434 1

Nested Loop (cost=0.86..239,832.57 rows=1 width=215) (actual time=1,686.004..5,050.869 rows=434 loops=1)

16. 2.364 5,007.037 ↓ 434.0 434 1

Nested Loop (cost=0.43..239,831.02 rows=1 width=177) (actual time=1,685.390..5,007.037 rows=434 loops=1)

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

Seq Scan on claim_reconciliation cr (cost=0.00..239,814.11 rows=2 width=73) (actual time=1,684.523..4,888.857 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,737
18. 115.816 115.816 ↓ 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.062..0.062 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. 43.400 43.400 ↑ 1.0 1 434

Index Scan using patient_insurance_plans_patient_id on patient_insurance_plans pip (cost=0.43..1.55 rows=1 width=42) (actual time=0.098..0.100 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. 41.664 41.664 ↑ 1.0 1 434

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

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

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

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

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

23. 121.520 121.520 ↑ 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.280 rows=3,052 loops=434)

24. 53.816 53.816 ↑ 1.6 1,193 434

Seq Scan on doctors doc (cost=0.00..69.20 rows=1,920 width=30) (actual time=0.002..0.124 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.373 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.003 0.061 ↑ 1.0 1 1

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

28. 0.016 0.016 ↓ 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.014..0.016 rows=6 loops=1)

  • Index Cond: ((category_type)::text = 'RECON'::text)
29. 0.042 0.042 ↓ 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.007..0.007 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. 7.812 7.812 ↑ 1.0 1 434

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

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

Index Scan using insurance_claim_resubmission_batch_id_index on insurance_claim_resubmission icrsub (cost=0.43..4.11 rows=93 width=29) (actual time=0.022..0.032 rows=6 loops=434)

  • Index Cond: ((resubmission_batch_id)::text = (isb.submission_batch_id)::text)
32. 14.756 14.756 ↑ 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.034 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. 532.084 532.084 ↑ 3.7 12,518 434

Seq Scan on insurance_plan_main ipm (cost=0.00..1,756.11 rows=46,111 width=47) (actual time=0.002..1.226 rows=12,518 loops=434)

35. 1.736 1.736 ↑ 1.0 1 434

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

  • Index Cond: (op_type = pr.op_type)
36. 4.340 4.340 ↓ 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.010..0.010 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. 23.205 23.205 ↑ 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.119..0.119 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.001..0.001 rows=1 loops=195)

Planning time : 20.113 ms
Execution time : 6,551.684 ms