explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8yTf

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 13,255.340 ↑ 1.0 1 1

Aggregate (cost=420.98..420.99 rows=1 width=8) (actual time=13,255.340..13,255.340 rows=1 loops=1)

2. 0.002 13,255.337 ↓ 0.0 0 1

Limit (cost=1.13..420.97 rows=1 width=48) (actual time=13,255.337..13,255.337 rows=0 loops=1)

3. 167.185 13,255.335 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.13..1,866,601.98 rows=4,446 width=48) (actual time=13,255.335..13,255.335 rows=0 loops=1)

  • Filter: (COALESCE(pr.center_id, isr.center_id) = ANY ('{0,100}'::integer[]))
  • Rows Removed by Filter: 784909
4. 302.861 11,518.332 ↓ 1.8 784,909 1

Nested Loop Left Join (cost=0.71..1,651,378.98 rows=444,620 width=19) (actual time=0.070..11,518.332 rows=784,909 loops=1)

5. 412.934 5,721.108 ↓ 1.8 784,909 1

Nested Loop (cost=0.28..866,861.82 rows=444,620 width=15) (actual time=0.059..5,721.108 rows=784,909 loops=1)

  • Join Filter: ((d.ddept_id)::text = (dd.ddept_id)::text)
  • Rows Removed by Join Filter: 1788148
6. 3.353 5,308.174 ↓ 1.0 917,232 1

Nested Loop (cost=0.28..791,592.91 rows=889,239 width=25) (actual time=0.050..5,308.174 rows=917,232 loops=1)

7. 2,553.125 2,553.125 ↓ 1.0 917,232 1

Seq Scan on tests_prescribed tp (cost=0.00..527,527.45 rows=889,239 width=23) (actual time=0.022..2,553.125 rows=917,232 loops=1)

  • Filter: (((priority)::text = ANY ('{S,U}'::text[])) AND ((conducted)::text = 'S'::text))
  • Rows Removed by Filter: 10852399
8. 2,751.696 2,751.696 ↑ 1.0 1 917,232

Index Scan using diagnostics_pkey on diagnostics d (cost=0.28..0.30 rows=1 width=18) (actual time=0.003..0.003 rows=1 loops=917,232)

  • Index Cond: ((test_id)::text = (tp.test_id)::text)
9. 0.000 0.000 ↑ 2.0 3 917,232

Materialize (cost=0.00..1.18 rows=6 width=10) (actual time=0.000..0.000 rows=3 loops=917,232)

10. 0.007 0.007 ↑ 1.0 6 1

Seq Scan on diagnostics_departments dd (cost=0.00..1.15 rows=6 width=10) (actual time=0.003..0.007 rows=6 loops=1)

  • Filter: ((category)::text = 'DEP_LAB'::text)
  • Rows Removed by Filter: 6
11. 5,494.363 5,494.363 ↑ 1.0 1 784,909

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.43..1.76 rows=1 width=20) (actual time=0.007..0.007 rows=1 loops=784,909)

  • Index Cond: ((patient_id)::text = (tp.pat_id)::text)
12. 1,569.818 1,569.818 ↓ 0.0 0 784,909

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.42..0.47 rows=1 width=13) (actual time=0.002..0.002 rows=0 loops=784,909)

  • Index Cond: ((tp.pat_id)::text = (incoming_visit_id)::text)
Planning time : 8.198 ms
Execution time : 13,255.424 ms