explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bYSa

Settings
# exclusive inclusive rows x rows loops node
1. 4.519 5,962.871 ↓ 195.0 195 1

Nested Loop Left Join (cost=683.74..67,176.52 rows=1 width=848) (actual time=4,440.914..5,962.871 rows=195 loops=1)

2. 0.206 5,955.622 ↓ 195.0 195 1

Nested Loop (cost=683.30..67,163.49 rows=1 width=607) (actual time=4,439.949..5,955.622 rows=195 loops=1)

3. 0.634 5,953.680 ↓ 434.0 434 1

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

4. 0.586 5,952.612 ↓ 434.0 434 1

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

5. 0.417 5,950.290 ↓ 434.0 434 1

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

6. 0.343 5,948.137 ↓ 434.0 434 1

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

7. 0.868 5,946.058 ↓ 434.0 434 1

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

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

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

9. 0.280 5,934.057 ↓ 434.0 434 1

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

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

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

11. 0.483 5,930.282 ↓ 434.0 434 1

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

12. 0.544 5,928.931 ↓ 434.0 434 1

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

13. 0.543 5,927.519 ↓ 434.0 434 1

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

14. 0.558 5,918.730 ↓ 434.0 434 1

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

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

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

16. 0.656 5,902.085 ↓ 434.0 434 1

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

17. 5,184.172 5,879.013 ↓ 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,466.212..5,879.013 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. 694.841 694.841 ↓ 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=694.841..694.841 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. 22.416 22.416 ↓ 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.012..0.012 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. 7.812 7.812 ↑ 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.018..0.018 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. 7.812 7.812 ↑ 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.018..0.018 rows=1 loops=434)

  • Index Cond: ((patient_id)::text = (pip.patient_id)::text)
  • Filter: (center_id = 9)
22. 8.246 8.246 ↑ 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.019..0.019 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.868 ↑ 1.0 1 434

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

  • Group Key: resub.claim_id
27. 0.352 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
28. 0.009 0.082 ↑ 1.0 1 1

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

29. 0.031 0.031 ↓ 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.030..0.031 rows=6 loops=1)

  • Index Cond: ((category_type)::text = 'RECON'::text)
30. 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
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. 7.812 7.812 ↑ 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.018 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.736 1.736 ↑ 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.004..0.004 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.736 1.736 ↓ 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.004..0.004 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.730 2.730 ↑ 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.014..0.014 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 : 28.654 ms
Execution time : 5,965.098 ms