explain.depesz.com

PostgreSQL's explain analyze made readable

Result: du38

Settings
# exclusive inclusive rows x rows loops node
1. 3.164 5,334.829 ↓ 195.0 195 1

Nested Loop Left Join (cost=683.74..67,176.52 rows=1 width=848) (actual time=3,938.797..5,334.829 rows=195 loops=1)

2. 0.409 5,329.520 ↓ 195.0 195 1

Nested Loop (cost=683.30..67,163.49 rows=1 width=607) (actual time=3,938.700..5,329.520 rows=195 loops=1)

3. 0.553 5,327.809 ↓ 434.0 434 1

Nested Loop Left Join (cost=682.88..67,155.03 rows=1 width=599) (actual time=2,105.636..5,327.809 rows=434 loops=1)

4. 0.492 5,326.822 ↓ 434.0 434 1

Nested Loop Left Join (cost=682.75..67,154.88 rows=1 width=584) (actual time=2,105.629..5,326.822 rows=434 loops=1)

5. 0.310 5,325.028 ↓ 434.0 434 1

Nested Loop Left Join (cost=682.46..67,154.57 rows=1 width=541) (actual time=2,105.619..5,325.028 rows=434 loops=1)

6. 0.243 5,322.982 ↓ 434.0 434 1

Nested Loop Left Join (cost=682.18..67,154.26 rows=1 width=517) (actual time=2,105.607..5,322.982 rows=434 loops=1)

7. 0.629 5,321.003 ↓ 434.0 434 1

Nested Loop Left Join (cost=681.91..67,153.97 rows=1 width=493) (actual time=2,105.596..5,321.003 rows=434 loops=1)

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

Nested Loop Left Join (cost=681.48..67,148.66 rows=1 width=487) (actual time=2,105.584..5,315.166 rows=434 loops=1)

9. 0.490 5,312.023 ↓ 434.0 434 1

Nested Loop Left Join (cost=681.06..67,140.22 rows=1 width=367) (actual time=2,105.572..5,312.023 rows=434 loops=1)

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

Nested Loop Left Join (cost=660.14..67,119.26 rows=1 width=335) (actual time=2,105.502..5,311.099 rows=434 loops=1)

11. 0.374 5,308.579 ↓ 434.0 434 1

Nested Loop Left Join (cost=659.86..67,118.97 rows=1 width=321) (actual time=2,105.489..5,308.579 rows=434 loops=1)

12. 0.438 5,307.337 ↓ 434.0 434 1

Nested Loop Left Join (cost=659.58..67,118.66 rows=1 width=295) (actual time=2,105.480..5,307.337 rows=434 loops=1)

13. 0.852 5,306.031 ↓ 434.0 434 1

Nested Loop (cost=659.44..67,118.51 rows=1 width=299) (actual time=2,105.472..5,306.031 rows=434 loops=1)

14. 0.396 5,299.971 ↓ 434.0 434 1

Nested Loop (cost=659.01..67,117.67 rows=1 width=246) (actual time=2,105.454..5,299.971 rows=434 loops=1)

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

Nested Loop (cost=658.58..67,116.53 rows=1 width=215) (actual time=2,105.434..5,294.367 rows=434 loops=1)

16. 0.368 5,288.846 ↓ 434.0 434 1

Nested Loop (cost=658.15..67,115.01 rows=1 width=177) (actual time=2,105.415..5,288.846 rows=434 loops=1)

17. 4,793.257 5,269.798 ↓ 934.0 1,868 1

Bitmap Heap Scan on claim_reconciliation cr (cost=657.71..67,098.11 rows=2 width=73) (actual time=2,105.364..5,269.798 rows=1,868 loops=1)

  • Recheck Cond: (((last_bill_open_date)::date >= '2016-01-01'::date) AND ((last_bill_open_date)::date <= '2020-08-27'::date))
  • Filter: (payment_ref_all ~~* '%50491720%'::text)
  • Rows Removed by Filter: 6,116,873
  • Heap Blocks: exact=98,838
18. 476.541 476.541 ↓ 195.3 6,118,741 1

Bitmap Index Scan on idx_claim_reconciliation_last_bill_open_date (cost=0.00..657.71 rows=31,328 width=0) (actual time=476.541..476.541 rows=6,118,741 loops=1)

  • Index Cond: (((last_bill_open_date)::date >= '2016-01-01'::date) AND ((last_bill_open_date)::date <= '2020-08-27'::date))
19. 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
20. 5.208 5.208 ↑ 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.012 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
21. 5.208 5.208 ↑ 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.012..0.012 rows=1 loops=434)

  • Index Cond: ((patient_id)::text = (pip.patient_id)::text)
  • Filter: (center_id = 9)
22. 5.208 5.208 ↑ 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.012..0.012 rows=1 loops=434)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
23. 0.868 0.868 ↑ 1.0 1 434

Index Scan using salutation_master_pkey on salutation_master sal (cost=0.14..0.16 rows=1 width=14) (actual time=0.002..0.002 rows=1 loops=434)

  • Index Cond: ((salutation_id)::text = (pd.salutation)::text)
24. 0.868 0.868 ↑ 1.0 1 434

Index Scan using insurance_category_master_pkey on insurance_category_master cat (cost=0.29..0.30 rows=1 width=26) (actual time=0.002..0.002 rows=1 loops=434)

  • Index Cond: (category_id = pip.plan_type_id)
25. 2.170 2.170 ↑ 1.0 1 434

Index Scan using doctors_pkey on doctors doc (cost=0.28..0.30 rows=1 width=30) (actual time=0.005..0.005 rows=1 loops=434)

  • Index Cond: ((doctor_id)::text = (pr.doctor)::text)
26. 0.434 0.434 ↑ 1.0 1 434

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

  • Group Key: resub.claim_id
27. 0.000 0.000 ↑ 1.0 1 434

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

  • Sort Key: resub.claim_id
  • Sort Method: quicksort Memory: 25kB
28. 0.006 0.050 ↑ 1.0 1 1

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

29. 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)
30. 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
31. 2.604 2.604 ↑ 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.006..0.006 rows=1 loops=434)

  • Index Cond: ((submission_batch_id)::text = COALESCE((max((isb_1.submission_batch_id)::text)), (cr.latest_resubmission_id)::text))
32. 5.208 5.208 ↑ 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.006..0.012 rows=6 loops=434)

  • Index Cond: ((resubmission_batch_id)::text = (isb.submission_batch_id)::text)
33. 1.736 1.736 ↑ 1.0 1 434

Index Scan using insurance_company_master_pkey on insurance_company_master icm (cost=0.28..0.29 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=434)

  • Index Cond: ((insurance_co_id)::text = (pip.insurance_co)::text)
34. 1.736 1.736 ↑ 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.004..0.004 rows=1 loops=434)

  • Index Cond: (((tpa_id)::text = (pip.sponsor_id)::text) AND ((tpa_id)::text = 'TPAID0048'::text))
35. 1.302 1.302 ↑ 1.0 1 434

Index Scan using insurance_plan_main_pkey on insurance_plan_main ipm (cost=0.29..0.31 rows=1 width=47) (actual time=0.003..0.003 rows=1 loops=434)

  • Index Cond: (plan_id = pip.plan_id)
36. 0.434 0.434 ↑ 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.001..0.001 rows=1 loops=434)

  • Index Cond: (op_type = pr.op_type)
37. 1.302 1.302 ↓ 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.003..0.003 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
38. 2.145 2.145 ↑ 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.011..0.011 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
39.          

SubPlan (for Nested Loop Left Join)

40. 0.000 0.000 ↑ 1.0 1 195

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

Planning time : 17.925 ms
Execution time : 5,335.461 ms