explain.depesz.com

PostgreSQL's explain analyze made readable

Result: viIg

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 11.693 ↑ 1.0 1 1

Limit (cost=2.72..8.86 rows=1 width=1,090) (actual time=11.685..11.693 rows=1 loops=1)

2. 0.022 11.684 ↑ 11,374,537.0 1 1

Nested Loop Left Join (cost=2.72..69,799,161.46 rows=11,374,537 width=1,090) (actual time=11.684..11.684 rows=1 loops=1)

3. 0.004 9.707 ↑ 11,374,537.0 1 1

Nested Loop Left Join (cost=2.29..63,613,928.38 rows=11,374,537 width=1,203) (actual time=9.707..9.707 rows=1 loops=1)

  • Join Filter: ((eet.code)::text = (pr.encounter_end_type)::text)
4. 0.002 9.068 ↑ 11,374,537.0 1 1

Nested Loop Left Join (cost=2.29..61,801,078.89 rows=11,374,537 width=1,175) (actual time=9.068..9.068 rows=1 loops=1)

5. 0.008 7.466 ↑ 11,374,537.0 1 1

Nested Loop Left Join (cost=1.85..56,132,073.31 rows=11,374,537 width=754) (actual time=7.466..7.466 rows=1 loops=1)

  • Join Filter: ((ohcm.center_id)::text = (dom.outsource_dest)::text)
  • Rows Removed by Join Filter: 38
6. 0.002 7.436 ↑ 11,374,537.0 1 1

Nested Loop Left Join (cost=1.85..44,530,040.93 rows=11,374,537 width=546) (actual time=7.436..7.436 rows=1 loops=1)

7. 0.006 7.430 ↑ 11,374,537.0 1 1

Nested Loop Left Join (cost=1.71..41,067,632.68 rows=11,374,537 width=531) (actual time=7.430..7.430 rows=1 loops=1)

  • Join Filter: (dom.outsource_dest_id = tp.outsource_dest_id)
  • Rows Removed by Join Filter: 82
8. 0.003 7.074 ↑ 11,374,537.0 1 1

Nested Loop Left Join (cost=1.71..27,076,950.15 rows=11,374,537 width=523) (actual time=7.074..7.074 rows=1 loops=1)

9. 0.002 3.048 ↑ 11,374,537.0 1 1

Nested Loop Left Join (cost=1.28..21,510,676.61 rows=11,374,537 width=511) (actual time=3.048..3.048 rows=1 loops=1)

  • Join Filter: ((sm.salutation_id)::text = (pd.salutation)::text)
10. 0.004 2.653 ↑ 11,374,537.0 1 1

Nested Loop (cost=1.28..18,082,803.62 rows=11,374,537 width=402) (actual time=2.653..2.653 rows=1 loops=1)

11. 0.003 1.989 ↑ 11,374,537.0 1 1

Nested Loop (cost=0.85..12,204,510.66 rows=11,374,537 width=351) (actual time=1.988..1.989 rows=1 loops=1)

12. 0.004 1.963 ↑ 11,374,537.0 1 1

Nested Loop (cost=0.71..10,416,651.88 rows=11,374,537 width=133) (actual time=1.963..1.963 rows=1 loops=1)

13. 0.008 0.098 ↑ 11,374,537.0 1 1

Nested Loop (cost=0.28..3,836,270.52 rows=11,374,537 width=110) (actual time=0.097..0.098 rows=1 loops=1)

14. 0.056 0.056 ↑ 11,374,537.0 1 1

Seq Scan on tests_prescribed tp (cost=0.00..480,658.37 rows=11,374,537 width=77) (actual time=0.056..0.056 rows=1 loops=1)

15. 0.034 0.034 ↑ 1.0 1 1

Index Scan using diagnostics_pkey on diagnostics d (cost=0.28..0.30 rows=1 width=41) (actual time=0.034..0.034 rows=1 loops=1)

  • Index Cond: ((test_id)::text = (tp.test_id)::text)
16. 1.861 1.861 ↑ 1.0 1 1

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.43..0.58 rows=1 width=38) (actual time=1.861..1.861 rows=1 loops=1)

  • Index Cond: ((patient_id)::text = (tp.pat_id)::text)
17. 0.023 0.023 ↑ 1.0 1 1

Index Scan using center_pkey on hospital_center_master hcm (cost=0.14..0.16 rows=1 width=222) (actual time=0.023..0.023 rows=1 loops=1)

  • Index Cond: (center_id = pr.center_id)
18. 0.660 0.660 ↑ 1.0 1 1

Index Scan using patient_details_pkey on patient_details pd (cost=0.43..0.52 rows=1 width=66) (actual time=0.660..0.660 rows=1 loops=1)

  • Index Cond: ((mr_no)::text = (tp.mr_no)::text)
19. 0.004 0.393 ↑ 21.0 1 1

Materialize (cost=0.00..1.31 rows=21 width=156) (actual time=0.393..0.393 rows=1 loops=1)

20. 0.389 0.389 ↑ 21.0 1 1

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

21. 4.023 4.023 ↑ 1.0 1 1

Index Scan using sample_collection_id_pkey on sample_collection sc (cost=0.43..0.49 rows=1 width=20) (actual time=4.023..4.023 rows=1 loops=1)

  • Index Cond: (sample_collection_id = tp.sample_collection_id)
22. 0.016 0.350 ↑ 1.0 82 1

Materialize (cost=0.00..2.23 rows=82 width=16) (actual time=0.331..0.350 rows=82 loops=1)

23. 0.334 0.334 ↑ 1.0 82 1

Seq Scan on diag_outsource_master dom (cost=0.00..1.82 rows=82 width=16) (actual time=0.327..0.334 rows=82 loops=1)

24. 0.004 0.004 ↓ 0.0 0 1

Index Scan using outhouse_master_pkey on outhouse_master om (cost=0.14..0.31 rows=1 width=26) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((oh_id)::text = (dom.outsource_dest)::text)
25. 0.007 0.022 ↑ 1.3 38 1

Materialize (cost=0.00..4.76 rows=51 width=222) (actual time=0.007..0.022 rows=38 loops=1)

26. 0.015 0.015 ↑ 1.3 38 1

Seq Scan on hospital_center_master ohcm (cost=0.00..4.51 rows=51 width=222) (actual time=0.005..0.015 rows=38 loops=1)

27. 1.600 1.600 ↑ 1.0 1 1

Index Scan using test_visit_reports_pkey on test_visit_reports tvr (cost=0.43..0.50 rows=1 width=429) (actual time=1.600..1.600 rows=1 loops=1)

  • Index Cond: (report_id = tp.report_id)
28. 0.005 0.635 ↑ 8.0 1 1

Materialize (cost=0.00..1.12 rows=8 width=80) (actual time=0.635..0.635 rows=1 loops=1)

29. 0.630 0.630 ↑ 8.0 1 1

Seq Scan on encounter_end_types eet (cost=0.00..1.08 rows=8 width=80) (actual time=0.630..0.630 rows=1 loops=1)

30. 1.955 1.955 ↑ 1.0 1 1

Index Scan using tests_conducted_index on tests_conducted tc (cost=0.43..0.52 rows=1 width=6) (actual time=1.955..1.955 rows=1 loops=1)

  • Index Cond: (prescribed_id = tp.prescribed_id)