explain.depesz.com

PostgreSQL's explain analyze made readable

Result: maOl

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 30,586.006 ↑ 1.0 1 1

Aggregate (cost=420.98..420.99 rows=1 width=8) (actual time=30,586.005..30,586.006 rows=1 loops=1)

2. 0.009 30,585.998 ↑ 1.0 1 1

Limit (cost=1.13..420.97 rows=1 width=48) (actual time=30,585.992..30,585.998 rows=1 loops=1)

3. 29.595 30,585.989 ↑ 4,446.0 1 1

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

  • Filter: (COALESCE(pr.center_id, isr.center_id) = ANY ('{0,22}'::integer[]))
  • Rows Removed by Filter: 34414
4. 78.510 20,989.024 ↑ 12.9 34,415 1

Nested Loop Left Join (cost=0.71..1,651,378.98 rows=444,620 width=19) (actual time=0.143..20,989.024 rows=34,415 loops=1)

5. 38.862 16,608.639 ↑ 12.9 34,415 1

Nested Loop (cost=0.28..866,861.82 rows=444,620 width=15) (actual time=0.097..16,608.639 rows=34,415 loops=1)

  • Join Filter: ((d.ddept_id)::text = (dd.ddept_id)::text)
  • Rows Removed by Join Filter: 49640
6. 18.281 16,569.777 ↑ 25.8 34,509 1

Nested Loop (cost=0.28..791,592.91 rows=889,239 width=25) (actual time=0.074..16,569.777 rows=34,509 loops=1)

7. 16,275.424 16,275.424 ↑ 25.8 34,509 1

Seq Scan on tests_prescribed tp (cost=0.00..527,527.45 rows=889,239 width=23) (actual time=0.029..16,275.424 rows=34,509 loops=1)

  • Filter: (((priority)::text = ANY ('{S,U}'::text[])) AND ((conducted)::text = 'S'::text))
  • Rows Removed by Filter: 400591
8. 276.072 276.072 ↑ 1.0 1 34,509

Index Scan using diagnostics_pkey on diagnostics d (cost=0.28..0.30 rows=1 width=18) (actual time=0.008..0.008 rows=1 loops=34,509)

  • Index Cond: ((test_id)::text = (tp.test_id)::text)
9. 0.000 0.000 ↑ 3.0 2 34,509

Materialize (cost=0.00..1.18 rows=6 width=10) (actual time=0.000..0.000 rows=2 loops=34,509)

10. 0.016 0.016 ↑ 1.0 6 1

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

  • Filter: ((category)::text = 'DEP_LAB'::text)
  • Rows Removed by Filter: 6
11. 4,301.875 4,301.875 ↑ 1.0 1 34,415

Index Scan using patient_registration_pkey on patient_registration pr (cost=0.43..1.76 rows=1 width=20) (actual time=0.125..0.125 rows=1 loops=34,415)

  • Index Cond: ((patient_id)::text = (tp.pat_id)::text)
12. 9,567.370 9,567.370 ↓ 0.0 0 34,415

Index Scan using incoming_sample_registration_pkey on incoming_sample_registration isr (cost=0.42..0.47 rows=1 width=13) (actual time=0.278..0.278 rows=0 loops=34,415)

  • Index Cond: ((tp.pat_id)::text = (incoming_visit_id)::text)
Planning time : 4.174 ms
Execution time : 30,586.285 ms