explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Y9cj

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 19,895.770 ↑ 1.0 1 1

Result (cost=420.97..420.98 rows=1 width=1) (actual time=19,895.770..19,895.770 rows=1 loops=1)

2.          

Initplan (for Result)

3. 265.817 19,895.767 ↓ 0.0 0 1

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

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

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

5. 443.854 11,919.887 ↓ 1.8 784,909 1

Nested Loop (cost=0.28..866,861.82 rows=444,620 width=15) (actual time=0.072..11,919.887 rows=784,909 loops=1)

  • Join Filter: ((d.ddept_id)::text = (dd.ddept_id)::text)
  • Rows Removed by Join Filter: 1788148
6. 195.530 11,476.033 ↓ 1.0 917,232 1

Nested Loop (cost=0.28..791,592.91 rows=889,239 width=25) (actual time=0.056..11,476.033 rows=917,232 loops=1)

7. 8,528.807 8,528.807 ↓ 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.036..8,528.807 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.013 0.013 ↑ 1.0 6 1

Seq Scan on diagnostics_departments dd (cost=0.00..1.15 rows=6 width=10) (actual time=0.005..0.013 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 : 3.151 ms
Execution time : 19,895.893 ms