explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UxvG

Settings
# exclusive inclusive rows x rows loops node
1. 0.609 22,072.256 ↑ 1.0 51 1

Limit (cost=25,383.66..25,383.78 rows=51 width=24) (actual time=22,071.337..22,072.256 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. 270.630 22,071.647 ↑ 1.8 51 1

Sort (cost=25,383.65..25,383.88 rows=94 width=24) (actual time=22,071.322..22,071.647 rows=51 loops=1)

  • Sort Key: thread.date_updated DESC, thread.id DESC
  • Sort Method: top-N heapsort Memory: 28kB
5. 6,005.250 21,801.017 ↓ 416.3 39,132 1

Nested Loop (cost=0.43..25,380.57 rows=94 width=24) (actual time=1.050..21,801.017 rows=39,132 loops=1)

6. 6,601.164 9,381.191 ↓ 999.8 400,911 1

Nested Loop (cost=0.00..25,054.52 rows=401 width=24) (actual time=0.074..9,381.191 rows=400,911 loops=1)

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

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

8. 2,779.981 2,779.981 ↑ 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,779.981 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.610 ms
Execution time : 22,072.689 ms