explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RJeq

Settings
# exclusive inclusive rows x rows loops node
1. 3.839 6,283.474 ↓ 195.0 195 1

Nested Loop Left Join (cost=683.74..67,176.52 rows=1 width=848) (actual time=4,104.188..6,283.474 rows=195 loops=1)

2. 0.239 6,273.005 ↓ 195.0 195 1

Nested Loop (cost=683.30..67,163.49 rows=1 width=607) (actual time=4,104.080..6,273.005 rows=195 loops=1)

3. 0.345 6,269.294 ↓ 434.0 434 1

Nested Loop Left Join (cost=682.88..67,155.03 rows=1 width=599) (actual time=2,194.984..6,269.294 rows=434 loops=1)

4. 0.724 6,268.081 ↓ 434.0 434 1

Nested Loop Left Join (cost=682.75..67,154.88 rows=1 width=584) (actual time=2,194.977..6,268.081 rows=434 loops=1)

5. 0.592 6,264.753 ↓ 434.0 434 1

Nested Loop Left Join (cost=682.46..67,154.57 rows=1 width=541) (actual time=2,194.966..6,264.753 rows=434 loops=1)

6. 0.520 6,262.425 ↓ 434.0 434 1

Nested Loop Left Join (cost=682.18..67,154.26 rows=1 width=517) (actual time=2,194.955..6,262.425 rows=434 loops=1)

7. 0.749 6,260.169 ↓ 434.0 434 1

Nested Loop Left Join (cost=681.91..67,153.97 rows=1 width=493) (actual time=2,194.943..6,260.169 rows=434 loops=1)

  • Join Filter: ((cr.claim_id)::text = (icrsub.claim_id)::text)
  • Rows Removed by Join Filter: 2,585
8. 0.791 6,210.378 ↓ 434.0 434 1

Nested Loop Left Join (cost=681.48..67,148.66 rows=1 width=487) (actual time=2,194.931..6,210.378 rows=434 loops=1)

9. 0.486 6,205.681 ↓ 434.0 434 1

Nested Loop Left Join (cost=681.06..67,140.22 rows=1 width=367) (actual time=2,194.919..6,205.681 rows=434 loops=1)

  • Join Filter: ((resub.claim_id)::text = (ic.claim_id)::text)
  • Rows Removed by Join Filter: 434
10. 0.648 6,204.327 ↓ 434.0 434 1

Nested Loop Left Join (cost=660.14..67,119.26 rows=1 width=335) (actual time=2,194.821..6,204.327 rows=434 loops=1)

11. 0.647 6,201.509 ↓ 434.0 434 1

Nested Loop Left Join (cost=659.86..67,118.97 rows=1 width=321) (actual time=2,194.807..6,201.509 rows=434 loops=1)

12. 0.777 6,199.994 ↓ 434.0 434 1

Nested Loop Left Join (cost=659.58..67,118.66 rows=1 width=295) (actual time=2,194.798..6,199.994 rows=434 loops=1)

13. 0.753 6,198.349 ↓ 434.0 434 1

Nested Loop (cost=659.44..67,118.51 rows=1 width=299) (actual time=2,194.789..6,198.349 rows=434 loops=1)

14. 0.745 6,170.688 ↓ 434.0 434 1

Nested Loop (cost=659.01..67,117.67 rows=1 width=246) (actual time=2,193.924..6,170.688 rows=434 loops=1)

  • Join Filter: ((ic.patient_id)::text = (pr.patient_id)::text)
15. 0.662 6,125.241 ↓ 434.0 434 1

Nested Loop (cost=658.58..67,116.53 rows=1 width=215) (actual time=2,193.893..6,125.241 rows=434 loops=1)

16. 2.012 6,114.597 ↓ 434.0 434 1

Nested Loop (cost=658.15..67,115.01 rows=1 width=177) (actual time=2,193.873..6,114.597 rows=434 loops=1)

17. 5,374.955 5,920.181 ↓ 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,193.805..5,920.181 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. 545.226 545.226 ↓ 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=545.226..545.226 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. 192.404 192.404 ↓ 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.103..0.103 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. 9.982 9.982 ↑ 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.023..0.023 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. 44.702 44.702 ↑ 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.103..0.103 rows=1 loops=434)

  • Index Cond: ((patient_id)::text = (pip.patient_id)::text)
  • Filter: (center_id = 9)
22. 26.908 26.908 ↑ 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.062..0.062 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.002..0.002 rows=1 loops=434)

  • Group Key: resub.claim_id
27. 0.359 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
28. 0.003 0.075 ↑ 1.0 1 1

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

29. 0.030 0.030 ↓ 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.029..0.030 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. 3.906 3.906 ↑ 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.009..0.009 rows=1 loops=434)

  • Index Cond: ((submission_batch_id)::text = COALESCE((max((isb_1.submission_batch_id)::text)), (cr.latest_resubmission_id)::text))
32. 49.042 49.042 ↑ 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.010..0.113 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. 2.604 2.604 ↑ 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.006..0.006 rows=1 loops=434)

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

  • Index Cond: (op_type = pr.op_type)
37. 3.472 3.472 ↓ 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.008..0.008 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. 6.630 6.630 ↑ 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.034..0.034 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.877 ms
Execution time : 6,284.097 ms