explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xiuw

Settings
# exclusive inclusive rows x rows loops node
1. 2.666 107.214 ↓ 40.0 40 1

Nested Loop Left Join (cost=2.12..5,736.03 rows=1 width=656) (actual time=3.564..107.214 rows=40 loops=1)

2. 1.507 103.348 ↓ 40.0 40 1

Nested Loop Left Join (cost=1.70..5,727.03 rows=1 width=455) (actual time=0.582..103.348 rows=40 loops=1)

  • Join Filter: ((stm.tpa_id)::text = (pr.secondary_sponsor_id)::text)
  • Rows Removed by Join Filter: 25,360
3. 1.193 100.401 ↓ 40.0 40 1

Nested Loop Left Join (cost=1.70..5,698.77 rows=1 width=431) (actual time=0.465..100.401 rows=40 loops=1)

  • Join Filter: ((tm.tpa_id)::text = (pr.primary_sponsor_id)::text)
  • Rows Removed by Join Filter: 18,092
4. 1.684 98.168 ↓ 40.0 40 1

Nested Loop Left Join (cost=1.70..5,670.50 rows=1 width=407) (actual time=0.408..98.168 rows=40 loops=1)

  • Join Filter: ((sicm.insurance_co_id)::text = (pr.secondary_insurance_co)::text)
  • Rows Removed by Join Filter: 28,800
5. 1.560 94.884 ↓ 40.0 40 1

Nested Loop Left Join (cost=1.70..5,642.30 rows=1 width=383) (actual time=0.296..94.884 rows=40 loops=1)

  • Join Filter: ((icm.insurance_co_id)::text = (pr.primary_insurance_co)::text)
  • Rows Removed by Join Filter: 24,039
6. 0.050 91.964 ↓ 40.0 40 1

Nested Loop Left Join (cost=1.70..5,614.10 rows=1 width=359) (actual time=0.198..91.964 rows=40 loops=1)

7. 0.108 91.394 ↓ 40.0 40 1

Nested Loop Left Join (cost=1.43..5,605.80 rows=1 width=345) (actual time=0.177..91.394 rows=40 loops=1)

  • Join Filter: ((pr.dept_name)::text = (dept.dept_id)::text)
  • Rows Removed by Join Filter: 943
8. 0.034 91.206 ↓ 40.0 40 1

Nested Loop Left Join (cost=1.43..5,603.47 rows=1 width=340) (actual time=0.168..91.206 rows=40 loops=1)

9. 0.035 90.492 ↓ 40.0 40 1

Nested Loop (cost=0.86..5,498.46 rows=1 width=300) (actual time=0.122..90.492 rows=40 loops=1)

  • Join Filter: ((pd.salutation)::text = (sm.salutation_id)::text)
10. 0.068 90.417 ↓ 40.0 40 1

Nested Loop (cost=0.86..5,496.98 rows=1 width=182) (actual time=0.110..90.417 rows=40 loops=1)

11. 90.029 90.029 ↓ 40.0 40 1

Index Scan using patient_registration_status_idx on patient_registration pr (cost=0.43..5,488.54 rows=1 width=120) (actual time=0.067..90.029 rows=40 loops=1)

  • Index Cond: ((status)::text = 'A'::text)
  • Filter: ((reg_date >= '2020-02-07'::date) AND (center_id = 9) AND ((codification_status = 'R'::bpchar) OR (codification_status = 'P'::bpchar)))
  • Rows Removed by Filter: 27,156
12. 0.320 0.320 ↑ 1.0 1 40

Index Scan using patient_details_pkey on patient_details pd (cost=0.43..8.45 rows=1 width=77) (actual time=0.008..0.008 rows=1 loops=40)

  • Index Cond: ((mr_no)::text = (pr.mr_no)::text)
13. 0.040 0.040 ↑ 21.0 1 40

Seq Scan on salutation_master sm (cost=0.00..1.21 rows=21 width=156) (actual time=0.001..0.001 rows=1 loops=40)

14. 0.680 0.680 ↓ 0.0 0 40

Index Scan using mrd_diagnosis_visit_index on mrd_diagnosis md (cost=0.56..104.92 rows=9 width=56) (actual time=0.017..0.017 rows=0 loops=40)

  • Index Cond: ((visit_id)::text = (pr.patient_id)::text)
  • Filter: (diag_type = 'P'::bpchar)
15. 0.080 0.080 ↑ 2.4 25 40

Seq Scan on department dept (cost=0.00..1.59 rows=59 width=21) (actual time=0.001..0.002 rows=25 loops=40)

16. 0.520 0.520 ↑ 1.0 1 40

Index Scan using doctors_pkey on doctors dr (cost=0.28..8.29 rows=1 width=30) (actual time=0.013..0.013 rows=1 loops=40)

  • Index Cond: ((pr.doctor)::text = (doctor_id)::text)
17. 1.360 1.360 ↑ 1.2 601 40

Seq Scan on insurance_company_master icm (cost=0.00..19.20 rows=720 width=32) (actual time=0.001..0.034 rows=601 loops=40)

18. 1.600 1.600 ↑ 1.0 720 40

Seq Scan on insurance_company_master sicm (cost=0.00..19.20 rows=720 width=32) (actual time=0.001..0.040 rows=720 loops=40)

19. 1.040 1.040 ↑ 1.4 453 40

Seq Scan on tpa_master tm (cost=0.00..20.34 rows=634 width=34) (actual time=0.001..0.026 rows=453 loops=40)

20. 1.440 1.440 ↑ 1.0 634 40

Seq Scan on tpa_master stm (cost=0.00..20.34 rows=634 width=34) (actual time=0.001..0.036 rows=634 loops=40)

21. 1.200 1.200 ↓ 0.0 0 40

Index Scan using idx_discharge_format_detail_docid on discharge_format_detail dfd (cost=0.42..8.44 rows=1 width=81) (actual time=0.030..0.030 rows=0 loops=40)

  • Index Cond: ((pr.patient_id)::text = (patient_id)::text)
  • Filter: ((pr.mr_no)::text = (mr_no)::text)
Planning time : 39.889 ms
Execution time : 110.327 ms