explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BDLz

Settings
# exclusive inclusive rows x rows loops node
1. 5.390 5,963.159 ↓ 195.0 195 1

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

2. 0.725 5,955.039 ↓ 195.0 195 1

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

3. 1.239 5,952.144 ↓ 434.0 434 1

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

4. 391.848 5,949.603 ↓ 434.0 434 1

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

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

Nested Loop Left Join (cost=23.77..240,420.41 rows=1 width=541) (actual time=1,571.863..5,009.613 rows=434 loops=1)

6. 16.535 5,006.663 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.50..240,420.11 rows=1 width=517) (actual time=1,571.851..5,006.663 rows=434 loops=1)

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

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

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

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

9. 0.901 4,963.732 ↓ 434.0 434 1

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

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

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

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

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

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

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

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

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

14. 0.855 4,634.105 ↓ 434.0 434 1

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

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

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

16. 0.965 4,620.251 ↓ 434.0 434 1

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

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

Seq Scan on claim_reconciliation cr (cost=0.00..239,815.49 rows=2 width=73) (actual time=1,570.758..4,600.606 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.944 6.944 ↑ 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.015..0.016 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. 7.812 7.812 ↑ 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.018..0.018 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. 124.124 124.124 ↑ 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.286 rows=3,052 loops=434)

24. 49.910 49.910 ↑ 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.115 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.383 0.434 ↑ 1.0 1 434

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

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

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

28. 0.014 0.014 ↓ 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.012..0.014 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.008..0.013 rows=6 loops=434)

  • Index Cond: ((resubmission_batch_id)::text = (isb.submission_batch_id)::text)
32. 15.190 15.190 ↑ 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.035 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. 548.142 548.142 ↑ 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.263 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 : 10.817 ms
Execution time : 5,963.563 ms