explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QOCh

Settings
# exclusive inclusive rows x rows loops node
1. 0.665 21,774.435 ↑ 1.0 51 1

Limit (cost=25,383.66..25,383.78 rows=51 width=24) (actual time=21,773.489..21,774.435 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.161 21,773.770 ↑ 1.8 51 1

Sort (cost=25,383.65..25,383.88 rows=94 width=24) (actual time=21,773.474..21,773.770 rows=51 loops=1)

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

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

6. 6,509.872 9,246.801 ↓ 999.8 400,911 1

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

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

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

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

Seq Scan on thread (cost=0.00..20,043.11 rows=400,911 width=124) (actual time=0.052..2,736.884 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.434 ms
Execution time : 21,774.831 ms