explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1ZBK

Settings
# exclusive inclusive rows x rows loops node
1. 0.609 20,679.699 ↑ 1.0 51 1

Limit (cost=25,383.66..25,383.78 rows=51 width=24) (actual time=20,678.802..20,679.699 rows=51 loops=1)

2.          

CTE current_userroles

3. 0.014 0.014 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.008..0.014 rows=1 loops=1)

4. 268.642 20,679.090 ↑ 1.8 51 1

Sort (cost=25,383.65..25,383.88 rows=94 width=24) (actual time=20,678.788..20,679.090 rows=51 loops=1)

  • Sort Key: thread.date_updated DESC, thread.id DESC
  • Sort Method: top-N heapsort Memory: 28kB
5. 5,839.005 20,410.448 ↓ 416.3 39,132 1

Nested Loop (cost=0.43..25,380.57 rows=94 width=24) (actual time=0.442..20,410.448 rows=39,132 loops=1)

6. 5,413.281 8,156.867 ↓ 999.8 400,911 1

Nested Loop (cost=0.00..25,054.52 rows=401 width=24) (actual time=0.071..8,156.867 rows=400,911 loops=1)

  • Join Filter: (thread.read_roles ?| current_userroles.roles)
7. 0.043 0.043 ↑ 1.0 1 1

CTE Scan on current_userroles (cost=0.00..0.02 rows=1 width=32) (actual time=0.025..0.043 rows=1 loops=1)

8. 2,743.543 2,743.543 ↑ 1.0 400,911 1

Seq Scan on thread (cost=0.00..20,043.11 rows=400,911 width=124) (actual time=0.017..2,743.543 rows=400,911 loops=1)

  • Filter: (NOT anonymized)
9. 6,414.576 6,414.576 ↓ 0.0 0 400,911

Index Scan using idx_thread_participant_thread_id on thread_participant_organization (cost=0.43..0.80 rows=1 width=16) (actual time=0.015..0.016 rows=0 loops=400,911)

  • Index Cond: (thread_id = thread.id)
  • Filter: (has_contributed AND (organization_type = 'OPERATOR'::text) AND (organization_id = '8bc90562-4eeb-4c7b-8207-ad38c5e43331'::text))
  • Rows Removed by Filter: 3
Planning time : 0.511 ms
Execution time : 20,680.097 ms