explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1MfO

Settings
# exclusive inclusive rows x rows loops node
1. 1.021 2,290.283 ↑ 11.6 332 1

WindowAgg (cost=0.57..189,096.93 rows=3,849 width=12) (actual time=2,290.224..2,290.283 rows=332 loops=1)

2. 815.793 2,289.262 ↑ 11.6 332 1

Nested Loop Left Join (cost=0.57..189,048.82 rows=3,849 width=4) (actual time=14.822..2,289.262 rows=332 loops=1)

  • Join Filter: (isolates.db_id = ANY (libraries.isolate_db_id))
  • Rows Removed by Join Filter: 6262570
3. 846.066 1,128.925 ↑ 1.1 291 1

Nested Loop Left Join (cost=0.57..16,985.99 rows=316 width=8) (actual time=2.743..1,128.925 rows=291 loops=1)

  • Join Filter: (samples.db_id = ANY (isolates.sample_db_id))
  • Rows Removed by Join Filter: 5105183
4. 0.391 5.419 ↓ 8.0 289 1

Nested Loop Left Join (cost=0.57..606.77 rows=36 width=8) (actual time=2.130..5.419 rows=289 loops=1)

5. 1.948 3.540 ↑ 6.5 2 1

Nested Loop Left Join (cost=0.28..598.27 rows=13 width=8) (actual time=2.113..3.540 rows=2 loops=1)

  • Join Filter: (patients.db_id = ANY (events.patient_db_id))
  • Rows Removed by Join Filter: 7320
6. 0.016 0.016 ↑ 1.0 1 1

Index Only Scan using patients_pkey on patients (cost=0.28..8.30 rows=1 width=4) (actual time=0.013..0.016 rows=1 loops=1)

  • Index Cond: (db_id = 1149)
  • Heap Fetches: 1
7. 1.576 1.576 ↑ 1.0 7,322 1

Seq Scan on events (cost=0.00..425.22 rows=7,322 width=29) (actual time=0.005..1.576 rows=7,322 loops=1)

8. 1.488 1.488 ↓ 48.0 144 2

Index Scan using samples_event_db_id on samples (cost=0.29..0.62 rows=3 width=8) (actual time=0.015..0.744 rows=144 loops=2)

  • Index Cond: (event_db_id = events.db_id)
9. 274.119 277.440 ↑ 1.0 17,666 289

Materialize (cost=0.00..523.99 rows=17,666 width=29) (actual time=0.000..0.960 rows=17,666 loops=289)

10. 3.321 3.321 ↑ 1.0 17,666 1

Seq Scan on isolates (cost=0.00..435.66 rows=17,666 width=29) (actual time=0.011..3.321 rows=17,666 loops=1)

11. 338.099 344.544 ↑ 1.0 21,522 291

Materialize (cost=0.00..2,092.83 rows=21,522 width=23) (actual time=0.000..1.184 rows=21,522 loops=291)

12. 6.445 6.445 ↑ 1.0 21,522 1

Seq Scan on libraries (cost=0.00..1,985.22 rows=21,522 width=23) (actual time=0.005..6.445 rows=21,522 loops=1)