explain.depesz.com

A tool for finding a real cause for slow queries.

Result: o7Ne

options
exclusive inclusive rows x rows loops node
154.253 34372.652 ↓ 8.4 6553 1

GroupAggregate (cost=292959.96..293473.42 rows=784 width=1863) (actual time=34285.213..34372.652 rows=6553 loops=1)

80.739 34218.399 ↓ 1.4 10727 1

Sort (cost=292959.96..292979.56 rows=7839 width=1863) (actual time=34213.723..34218.399 rows=10727 loops=1)

  • Sort Key: posts.thread_id, posts.parentid, posts."timestamp", posts.id, posts.name, posts.tripcode, posts.email, posts.subject, posts.message, posts.ipmd5, posts.tag, posts.stickied, posts.locked, posts.posterauthority, posts.reviewed, posts.deleted_timestamp
  • Sort Method: external merge Disk: 1488kB
13.792 34137.660 ↓ 1.4 10727 1

Nested Loop Left Join (cost=13327.05..279803.91 rows=7839 width=1863) (actual time=409.763..34137.660 rows=10727 loops=1)

  • Join Filter: (post_files.boardid = posts.boardid)
4.122 140.010 ↑ 1.2 6553 1

Subquery Scan on posts (cost=13327.05..14091.39 rows=7839 width=1844) (actual time=91.836..140.010 rows=6553 loops=1)

  • Filter: (posts.replycount < 1000)
42.014 135.888 ↓ 1.0 23813 1

WindowAgg (cost=13327.05..13797.41 rows=23518 width=284) (actual time=86.238..135.888 rows=23813 loops=1)

67.414 93.874 ↓ 1.0 23813 1

Sort (cost=13327.05..13385.85 rows=23518 width=284) (actual time=80.418..93.874 rows=23813 loops=1)

  • Sort Key: (CASE WHEN (public.posts.parentid = 0) THEN public.posts.id ELSE public.posts.parentid END)
  • Sort Method: external merge Disk: 6112kB
22.867 26.460 ↓ 1.0 23813 1

Bitmap Heap Scan on posts (cost=530.92..8483.47 rows=23518 width=284) (actual time=3.901..26.460 rows=23813 loops=1)

  • Recheck Cond: (boardid = 22)
  • Filter: (is_deleted = 0)
3.593 3.593 ↑ 1.0 25537 1

Bitmap Index Scan on posts_pkey (cost=0.00..525.05 rows=25703 width=0) (actual time=3.593..3.593 rows=25537 loops=1)

  • Index Cond: (boardid = 22)
33983.858 33983.858 ↑ 4.7 3 6553

Index Scan using id on post_files (cost=0.00..33.69 rows=14 width=27) (actual time=1.531..5.186 rows=3 loops=6553)

  • Index Cond: (post_files.id = posts.id)