explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3Z6Y

Settings
# exclusive inclusive rows x rows loops node
1. 5.413 5,969.974 ↓ 195.0 195 1

Nested Loop Left Join (cost=24.48..242,803.59 rows=1 width=848) (actual time=3,362.094..5,969.974 rows=195 loops=1)

2. 0.609 5,961.831 ↓ 195.0 195 1

Nested Loop (cost=24.05..242,790.57 rows=1 width=607) (actual time=3,362.001..5,961.831 rows=195 loops=1)

3. 1.190 5,959.052 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.63..242,782.11 rows=1 width=599) (actual time=1,634.473..5,959.052 rows=434 loops=1)

4. 381.668 5,956.560 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.50..242,781.95 rows=1 width=584) (actual time=1,634.460..5,956.560 rows=434 loops=1)

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

Nested Loop Left Join (cost=23.50..240,450.24 rows=1 width=541) (actual time=1,633.329..5,043.676 rows=434 loops=1)

  • Join Filter: ((tpa.tpa_id)::text = (pip.sponsor_id)::text)
  • Rows Removed by Join Filter: 274,722
6. 16.075 4,996.265 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.50..240,421.93 rows=1 width=517) (actual time=1,633.180..4,996.265 rows=434 loops=1)

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

Nested Loop Left Join (cost=23.50..240,393.69 rows=1 width=493) (actual time=1,633.100..4,965.868 rows=434 loops=1)

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

Nested Loop Left Join (cost=23.07..240,388.38 rows=1 width=487) (actual time=1,633.087..4,959.204 rows=434 loops=1)

9. 0.830 4,955.007 ↓ 434.0 434 1

Nested Loop Left Join (cost=22.65..240,379.94 rows=1 width=367) (actual time=1,633.075..4,955.007 rows=434 loops=1)

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

Nested Loop Left Join (cost=1.73..240,358.98 rows=1 width=335) (actual time=1,633.002..4,953.309 rows=434 loops=1)

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

Nested Loop Left Join (cost=1.73..240,265.76 rows=1 width=321) (actual time=1,632.743..4,859.412 rows=434 loops=1)

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

Nested Loop Left Join (cost=1.73..239,839.19 rows=1 width=295) (actual time=1,632.170..4,652.153 rows=434 loops=1)

13. 1.744 4,645.964 ↓ 434.0 434 1

Nested Loop Left Join (cost=1.29..239,837.67 rows=1 width=273) (actual time=1,632.151..4,645.964 rows=434 loops=1)

  • Join Filter: ((sal.salutation_id)::text = (pd.salutation)::text)
  • Rows Removed by Join Filter: 697
14. 1.023 4,643.786 ↓ 434.0 434 1

Nested Loop (cost=1.29..239,836.20 rows=1 width=277) (actual time=1,632.140..4,643.786 rows=434 loops=1)

15. 0.625 4,637.121 ↓ 434.0 434 1

Nested Loop (cost=0.86..239,835.37 rows=1 width=224) (actual time=1,632.120..4,637.121 rows=434 loops=1)

16. 0.692 4,630.854 ↓ 434.0 434 1

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

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

Seq Scan on claim_reconciliation cr (cost=0.00..239,815.49 rows=2 width=73) (actual time=1,632.063..4,611.482 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. 5.642 5.642 ↑ 1.0 1 434

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

  • Index Cond: ((patient_id)::text = (ic.patient_id)::text)
  • Filter: (center_id = 9)
20. 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)
21. 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)

22. 5.642 5.642 ↑ 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.012..0.013 rows=1 loops=434)

  • Index Cond: ((patient_id)::text = (ic.patient_id)::text)
  • Filter: (plan_id = ic.plan_id)
  • Rows Removed by Filter: 0
23. 118.916 118.916 ↑ 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.274 rows=3,052 loops=434)

24. 48.174 48.174 ↑ 1.6 1,193 434

Seq Scan on doctors doc (cost=0.00..69.21 rows=1,921 width=30) (actual time=0.002..0.111 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.381 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.007 0.053 ↑ 1.0 1 1

Nested Loop (cost=0.85..20.91 rows=1 width=23) (actual time=0.028..0.053 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.030 0.030 ↓ 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.005..0.005 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. 23.002 23.002 ↑ 1.0 634 434

Seq Scan on tpa_master tpa (cost=0.00..20.36 rows=636 width=34) (actual time=0.002..0.053 rows=634 loops=434)

34. 531.216 531.216 ↑ 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.224 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.001..0.001 rows=1 loops=195)

Planning time : 12.479 ms
Execution time : 5,970.366 ms