explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nW2h

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 22,552.743 ↑ 1.0 1 1

Aggregate (cost=1,528.51..1,528.52 rows=1 width=8) (actual time=22,552.743..22,552.743 rows=1 loops=1)

2. 0.002 22,552.737 ↓ 0.0 0 1

Limit (cost=1.12..1,528.50 rows=1 width=48) (actual time=22,552.737..22,552.737 rows=0 loops=1)

3. 32.006 22,552.735 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.12..13,747.47 rows=9 width=48) (actual time=22,552.735..22,552.735 rows=0 loops=1)

  • Filter: (COALESCE(pr.center_id, isr.center_id) = ANY ('{0,20}'::integer[]))
  • Rows Removed by Filter: 9748
4. 23.193 22,413.501 ↓ 11.4 9,748 1

Nested Loop Left Join (cost=0.85..13,474.52 rows=854 width=19) (actual time=1.665..22,413.501 rows=9,748 loops=1)

5. 5.805 808.236 ↓ 11.4 9,748 1

Nested Loop (cost=0.42..9,626.40 rows=854 width=15) (actual time=1.607..808.236 rows=9,748 loops=1)

6. 2.170 4.142 ↓ 6.4 761 1

Nested Loop (cost=0.00..67.01 rows=118 width=8) (actual time=0.032..4.142 rows=761 loops=1)

  • Join Filter: ((d.ddept_id)::text = (dd.ddept_id)::text)
  • Rows Removed by Join Filter: 7735
7. 0.034 0.034 ↓ 6.0 6 1

Seq Scan on diagnostics_departments dd (cost=0.00..1.15 rows=1 width=38) (actual time=0.020..0.034 rows=6 loops=1)

  • Filter: ((category)::text = 'DEP_LAB'::text)
  • Rows Removed by Filter: 6
8. 1.938 1.938 ↑ 1.0 1,416 6

Seq Scan on diagnostics d (cost=0.00..48.16 rows=1,416 width=18) (actual time=0.007..0.323 rows=1,416 loops=6)

9. 798.289 798.289 ↑ 1.2 13 761

Index Scan using tests_prescribed_test_id_idx on tests_prescribed tp (cost=0.42..80.86 rows=15 width=23) (actual time=0.195..1.049 rows=13 loops=761)

  • Index Cond: ((test_id)::text = (d.test_id)::text)
  • Filter: (((priority)::text = ANY ('{S,U}'::text[])) AND ((conducted)::text = 'S'::text))
  • Rows Removed by Filter: 778
10. 21,582.072 21,582.072 ↑ 1.0 1 9,748

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.42..4.51 rows=1 width=20) (actual time=2.214..2.214 rows=1 loops=9,748)

  • Index Cond: ((patient_id)::text = (tp.pat_id)::text)
11. 107.228 107.228 ↓ 0.0 0 9,748

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.28..0.31 rows=1 width=13) (actual time=0.011..0.011 rows=0 loops=9,748)

  • Index Cond: ((tp.pat_id)::text = (incoming_visit_id)::text)
Planning time : 3.521 ms
Execution time : 22,553.045 ms