explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mZDB

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.337 ↑ 1.0 1 1

Result (cost=420.97..420.98 rows=1 width=1) (actual time=0.336..0.337 rows=1 loops=1)

2.          

Initplan (for Result)

3. 0.010 0.335 ↑ 4,446.0 1 1

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

  • Filter: (COALESCE(pr.center_id, isr.center_id) = ANY ('{0,22}'::integer[]))
  • Rows Removed by Filter: 14
4. 0.009 0.280 ↑ 29,641.3 15 1

Nested Loop Left Join (cost=0.71..1,651,378.98 rows=444,620 width=19) (actual time=0.038..0.280 rows=15 loops=1)

5. 0.000 0.136 ↑ 29,641.3 15 1

Nested Loop (cost=0.28..866,861.82 rows=444,620 width=15) (actual time=0.028..0.136 rows=15 loops=1)

  • Join Filter: ((d.ddept_id)::text = (dd.ddept_id)::text)
  • Rows Removed by Join Filter: 28
6. 0.003 0.123 ↑ 59,282.6 15 1

Nested Loop (cost=0.28..791,592.91 rows=889,239 width=25) (actual time=0.022..0.123 rows=15 loops=1)

7. 0.045 0.045 ↑ 59,282.6 15 1

Seq Scan on tests_prescribed tp (cost=0.00..527,527.45 rows=889,239 width=23) (actual time=0.011..0.045 rows=15 loops=1)

  • Filter: (((priority)::text = ANY ('{S,U}'::text[])) AND ((conducted)::text = 'S'::text))
  • Rows Removed by Filter: 130
8. 0.075 0.075 ↑ 1.0 1 15

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

  • Index Cond: ((test_id)::text = (tp.test_id)::text)
9. 0.011 0.015 ↑ 2.0 3 15

Materialize (cost=0.00..1.18 rows=6 width=10) (actual time=0.000..0.001 rows=3 loops=15)

10. 0.004 0.004 ↑ 1.2 5 1

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

  • Filter: ((category)::text = 'DEP_LAB'::text)
  • Rows Removed by Filter: 6
11. 0.135 0.135 ↑ 1.0 1 15

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.43..1.76 rows=1 width=20) (actual time=0.009..0.009 rows=1 loops=15)

  • Index Cond: ((patient_id)::text = (tp.pat_id)::text)
12. 0.045 0.045 ↓ 0.0 0 15

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.42..0.47 rows=1 width=13) (actual time=0.003..0.003 rows=0 loops=15)

  • Index Cond: ((tp.pat_id)::text = (incoming_visit_id)::text)
Planning time : 1.669 ms
Execution time : 0.397 ms