explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CW2s

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 20.563 5,114.946 ↑ 1.0 101 1

Limit (cost=386,284.52..386,284.78 rows=101 width=303) (actual time=5,094.373..5,114.946 rows=101 loops=1)

2. 92.251 5,094.383 ↑ 2,814.8 101 1

Sort (cost=386,284.52..386,995.25 rows=284,290 width=303) (actual time=5,094.373..5,094.383 rows=101 loops=1)

  • Sort Key: thread.date_updated DESC NULLS LAST, thread.id DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 191kB
3. 3,082.997 5,002.132 ↑ 1.0 284,290 1

GroupAggregate (cost=250,855.48..375,398.76 rows=284,290 width=303) (actual time=1,280.617..5,002.132 rows=284,290 loops=1)

  • Group Key: thread.id
4. 0.000 1,919.135 ↑ 1.0 852,870 1

Gather Merge (cost=250,855.48..362,605.71 rows=852,870 width=385) (actual time=1,280.574..1,919.135 rows=852,870 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 275.037 4,990.857 ↑ 1.2 284,290 3

Merge Join (cost=249,855.46..263,163.32 rows=355,362 width=385) (actual time=1,234.770..1,663.619 rows=284,290 loops=3)

  • Merge Cond: (thread_participant_organization.thread_id = thread.id)
6. 338.727 3,441.603 ↑ 1.2 284,290 3

Merge Join (cost=147,314.14..154,993.60 rows=346,720 width=178) (actual time=879.425..1,147.201 rows=284,290 loops=3)

  • Merge Cond: (thread_participant_organization.thread_id = thread_entity.thread_id)
7. 588.150 1,204.662 ↑ 1.2 284,290 3

Sort (cost=81,083.34..81,971.75 rows=355,362 width=104) (actual time=341.405..401.554 rows=284,290 loops=3)

  • Sort Key: thread_participant_organization.thread_id DESC NULLS LAST
  • Sort Method: external merge Disk: 29448kB
  • Worker 0: Sort Method: external merge Disk: 27264kB
  • Worker 1: Sort Method: external merge Disk: 26208kB
8. 438.846 616.512 ↑ 1.2 284,290 3

Parallel Hash Join (cost=6,755.08..28,885.37 rows=355,362 width=104) (actual time=122.615..205.504 rows=284,290 loops=3)

  • Hash Cond: ((thread_participant_organization.organization_type = organization.type) AND (thread_participant_organization.organization_id = organization.id))
9. 107.424 107.424 ↑ 1.2 284,290 3

Parallel Seq Scan on thread_participant_organization (cost=0.00..12,082.62 rows=355,362 width=50) (actual time=0.188..35.808 rows=284,290 loops=3)

10. 50.298 70.242 ↑ 1.2 72,515 3

Parallel Hash (cost=4,155.43..4,155.43 rows=90,643 width=87) (actual time=23.414..23.414 rows=72,515 loops=3)

  • Buckets: 32768 Batches: 8 Memory Usage: 3648kB
11. 19.944 19.944 ↑ 1.2 72,515 3

Parallel Seq Scan on organization (cost=0.00..4,155.43 rows=90,643 width=87) (actual time=0.008..6.648 rows=72,515 loops=3)

12. 103.689 1,898.214 ↓ 1.3 360,354 3

Materialize (cost=66,230.80..67,652.25 rows=284,290 width=74) (actual time=538.013..632.738 rows=360,354 loops=3)

13. 547.389 1,794.525 ↑ 1.0 284,290 3

Sort (cost=66,230.80..66,941.52 rows=284,290 width=74) (actual time=538.010..598.175 rows=284,290 loops=3)

  • Sort Key: thread_entity.thread_id DESC NULLS LAST
  • Sort Method: external merge Disk: 22592kB
  • Worker 0: Sort Method: external merge Disk: 22592kB
  • Worker 1: Sort Method: external merge Disk: 22592kB
14. 741.417 1,247.136 ↑ 1.0 284,290 3

Hash Join (cost=13,084.95..27,843.38 rows=284,290 width=74) (actual time=128.406..415.712 rows=284,290 loops=3)

  • Hash Cond: ((thread_entity.entity_type = ent.type) AND (thread_entity.entity_id = ent.id))
15. 121.164 121.164 ↑ 1.0 284,290 3

Seq Scan on thread_entity (cost=0.00..5,212.90 rows=284,290 width=38) (actual time=0.016..40.388 rows=284,290 loops=3)

16. 190.533 384.555 ↑ 1.0 284,278 3

Hash (cost=5,211.78..5,211.78 rows=284,278 width=80) (actual time=128.184..128.185 rows=284,278 loops=3)

  • Buckets: 65536 Batches: 16 Memory Usage: 2415kB
17. 194.022 194.022 ↑ 1.0 284,278 3

Seq Scan on entity ent (cost=0.00..5,211.78 rows=284,278 width=80) (actual time=0.019..64.674 rows=284,278 loops=3)

18. 1,030.722 1,274.217 ↑ 1.0 284,290 3

Sort (cost=102,541.32..103,252.04 rows=284,290 width=239) (actual time=355.338..424.739 rows=284,290 loops=3)

  • Sort Key: thread.id DESC NULLS LAST
  • Sort Method: external merge Disk: 69952kB
  • Worker 0: Sort Method: external merge Disk: 69960kB
  • Worker 1: Sort Method: external merge Disk: 69952kB
19. 243.495 243.495 ↑ 1.0 284,290 3

Seq Scan on thread (cost=0.00..12,654.90 rows=284,290 width=239) (actual time=0.133..81.165 rows=284,290 loops=3)

Planning time : 1.960 ms