explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vPV

Settings
# exclusive inclusive rows x rows loops node
1. 7.748 7,431.620 ↓ 195.0 195 1

Nested Loop Left Join (cost=24.76..242,773.18 rows=1 width=1,061) (actual time=3,944.007..7,431.620 rows=195 loops=1)

2. 0.588 7,371.807 ↓ 195.0 195 1

Nested Loop (cost=24.32..242,760.15 rows=1 width=820) (actual time=3,939.679..7,371.807 rows=195 loops=1)

3. 1.210 7,350.387 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.90..242,751.69 rows=1 width=812) (actual time=1,933.608..7,350.387 rows=434 loops=1)

4. 402.621 7,347.007 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.77..242,751.54 rows=1 width=696) (actual time=1,933.292..7,347.007 rows=434 loops=1)

  • Join Filter: (ipm.plan_id = pip.plan_id)
  • Rows Removed by Join Filter: 5,432,541
5. 0.972 6,312.048 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.77..240,419.04 rows=1 width=653) (actual time=1,927.504..6,312.048 rows=434 loops=1)

6. 17.105 6,308.472 ↓ 434.0 434 1

Nested Loop Left Join (cost=23.50..240,418.73 rows=1 width=629) (actual time=1,927.187..6,308.472 rows=434 loops=1)

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

Nested Loop Left Join (cost=23.50..240,390.49 rows=1 width=605) (actual time=1,926.425..6,274.875 rows=434 loops=1)

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

Nested Loop Left Join (cost=23.07..240,385.21 rows=1 width=599) (actual time=1,925.846..5,995.655 rows=434 loops=1)

9. 1.159 5,978.154 ↓ 434.0 434 1

Nested Loop Left Join (cost=22.65..240,376.78 rows=1 width=480) (actual time=1,924.997..5,978.154 rows=434 loops=1)

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

Nested Loop Left Join (cost=1.73..240,355.81 rows=1 width=448) (actual time=1,923.771..5,974.825 rows=434 loops=1)

  • Join Filter: ((doc.doctor_id)::text = (pr.doctor)::text)
  • Rows Removed by Join Filter: 517,206
11. 98.959 5,866.328 ↓ 434.0 434 1

Nested Loop Left Join (cost=1.73..240,262.61 rows=1 width=434) (actual time=1,920.478..5,866.328 rows=434 loops=1)

  • Join Filter: (cat.category_id = pip.plan_type_id)
  • Rows Removed by Join Filter: 1,324,118
12. 1.210 5,630.225 ↓ 434.0 434 1

Nested Loop Left Join (cost=1.73..239,836.05 rows=1 width=408) (actual time=1,916.049..5,630.225 rows=434 loops=1)

  • Join Filter: ((sal.salutation_id)::text = (pd.salutation)::text)
  • Rows Removed by Join Filter: 697
13. 1.155 5,628.147 ↓ 434.0 434 1

Nested Loop (cost=1.73..239,834.57 rows=1 width=299) (actual time=1,916.036..5,628.147 rows=434 loops=1)

14. 0.970 5,479.866 ↓ 434.0 434 1

Nested Loop (cost=1.30..239,833.73 rows=1 width=246) (actual time=1,913.807..5,479.866 rows=434 loops=1)

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

Nested Loop (cost=0.86..239,832.60 rows=1 width=215) (actual time=1,913.297..5,433.760 rows=434 loops=1)

16. 2.267 5,423.974 ↓ 434.0 434 1

Nested Loop (cost=0.43..239,831.04 rows=1 width=177) (actual time=1,913.248..5,423.974 rows=434 loops=1)

17. 5,346.987 5,346.987 ↓ 934.0 1,868 1

Seq Scan on claim_reconciliation cr (cost=0.00..239,814.14 rows=2 width=73) (actual time=1,912.674..5,346.987 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,738
18. 74.720 74.720 ↓ 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.040..0.040 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. 9.114 9.114 ↑ 1.0 1 434

Index Scan using patient_insurance_plans_patient_id on patient_insurance_plans pip (cost=0.43..1.55 rows=1 width=42) (actual time=0.020..0.021 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. 45.136 45.136 ↑ 1.0 1 434

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

  • Index Cond: ((patient_id)::text = (pip.patient_id)::text)
  • Filter: (center_id = 9)
21. 147.126 147.126 ↑ 1.0 1 434

Index Scan using patient_details_pkey on patient_details pd (cost=0.43..0.84 rows=1 width=68) (actual time=0.339..0.339 rows=1 loops=434)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
22. 0.868 0.868 ↑ 7.0 3 434

Seq Scan on salutation_master sal (cost=0.00..1.21 rows=21 width=156) (actual time=0.002..0.002 rows=3 loops=434)

23. 137.144 137.144 ↑ 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.002..0.316 rows=3,052 loops=434)

24. 59.458 59.458 ↑ 1.6 1,193 434

Seq Scan on doctors doc (cost=0.00..69.20 rows=1,920 width=30) (actual time=0.002..0.137 rows=1,193 loops=434)

25. 0.868 2.170 ↑ 1.0 1 434

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

  • Group Key: resub.claim_id
26. 0.147 1.302 ↑ 1.0 1 434

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

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

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

28. 0.571 0.571 ↓ 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.569..0.571 rows=6 loops=1)

  • Index Cond: ((category_type)::text = 'RECON'::text)
29. 0.576 0.576 ↓ 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.096..0.096 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. 16.058 16.058 ↑ 1.0 1 434

Index Scan using insurance_submission_batch_pkey on insurance_submission_batch isb (cost=0.42..8.44 rows=1 width=128) (actual time=0.037..0.037 rows=1 loops=434)

  • Index Cond: ((submission_batch_id)::text = COALESCE((max((isb_1.submission_batch_id)::text)), (cr.latest_resubmission_id)::text))
31. 277.760 277.760 ↑ 15.5 6 434

Index Scan using insurance_claim_resubmission_batch_id_index on insurance_claim_resubmission icrsub (cost=0.43..4.11 rows=93 width=29) (actual time=0.026..0.640 rows=6 loops=434)

  • Index Cond: ((resubmission_batch_id)::text = (isb.submission_batch_id)::text)
32. 16.492 16.492 ↑ 1.7 422 434

Seq Scan on insurance_company_master icm (cost=0.00..19.22 rows=722 width=32) (actual time=0.003..0.038 rows=422 loops=434)

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

  • Index Cond: (((tpa_id)::text = (pip.sponsor_id)::text) AND ((tpa_id)::text = 'TPAID0048'::text))
34. 632.338 632.338 ↑ 3.7 12,518 434

Seq Scan on insurance_plan_main ipm (cost=0.00..1,756.11 rows=46,111 width=47) (actual time=0.004..1.457 rows=12,518 loops=434)

35. 2.170 2.170 ↑ 1.0 1 434

Index Scan using op_type_names_pkey on op_type_names otn (cost=0.13..0.15 rows=1 width=126) (actual time=0.005..0.005 rows=1 loops=434)

  • Index Cond: (op_type = pr.op_type)
36. 20.832 20.832 ↓ 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.048..0.048 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. 51.870 51.870 ↑ 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.266..0.266 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 : 56.060 ms
Execution time : 7,433.382 ms