explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 51Vw

Settings
# exclusive inclusive rows x rows loops node
1. 0.050 674.147 ↑ 11.5 32 1

Sort (cost=13,581.69..13,582.61 rows=367 width=137) (actual time=674.145..674.147 rows=32 loops=1)

  • Sort Key: ranked_messages.max_rank_value DESC, ranked_messages.rank_value DESC
  • Sort Method: quicksort Memory: 36kB
2. 1.220 674.097 ↑ 11.5 32 1

Subquery Scan on ranked_messages (cost=13,136.36..13,566.06 rows=367 width=137) (actual time=672.879..674.097 rows=32 loops=1)

  • Filter: (ranked_messages.rank <= 4)
  • Rows Removed by Filter: 13
3. 0.126 672.877 ↑ 24.5 45 1

WindowAgg (cost=13,136.36..13,359.52 rows=1,102 width=196) (actual time=672.765..672.877 rows=45 loops=1)

4. 0.000 672.751 ↑ 24.5 45 1

Sort (cost=13,136.36..13,139.12 rows=1,102 width=168) (actual time=672.745..672.751 rows=45 loops=1)

  • Sort Key: backlog.bufferid, ((((CASE WHEN (backlog.type = ANY ('{1,4}'::integer[])) THEN 1.0 WHEN (backlog.type = ANY ('{2,1024,2048,4096,16384}'::integer[])) THEN 0.8 WHEN (backlog.type = ANY ('{32,64,128,256,512,32768,65536}'::integer[])) THEN 0.6 WHEN (backlog.type = ANY ('{8,16,8192,131072}'::integer[])) THEN 0.4 ELSE 0.2 END ^ '32'::numeric))::double precision * (('1'::double precision / (date_part('epoch'::text, CURRENT_TIMESTAMP) - date_part('epoch'::text, backlog."time"))) ^ '1'::double precision))) DESC
  • Sort Method: quicksort Memory: 41kB
5. 26.425 676.244 ↑ 24.5 45 1

Gather (cost=2,366.48..13,080.68 rows=1,102 width=168) (actual time=15.189..676.244 rows=45 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
6. 0.385 649.819 ↑ 29.5 22 2 / 2

Nested Loop (cost=1,366.48..11,970.48 rows=648 width=168) (actual time=17.074..649.819 rows=22 loops=2)

7. 0.088 620.791 ↑ 29.5 22 2 / 2

Hash Join (cost=1,366.05..6,624.19 rows=648 width=121) (actual time=16.964..620.791 rows=22 loops=2)

  • Hash Cond: (buffer.networkid = network.networkid)
8. 0.131 620.649 ↑ 29.5 22 2 / 2

Hash Join (cost=1,354.96..6,545.88 rows=648 width=84) (actual time=16.857..620.649 rows=22 loops=2)

  • Hash Cond: (backlog.bufferid = buffer.bufferid)
9. 617.775 620.094 ↑ 18.2 42 2 / 2

Parallel Bitmap Heap Scan on backlog (cost=1,170.08..6,358.89 rows=765 width=71) (actual time=16.419..620.094 rows=42 loops=2)

  • Recheck Cond: ((tsv @@ '''sexualis'''::tsquery) AND ((type & 23559) > 0))
  • Heap Blocks: exact=37
10. 2.319 2.319 ↑ 15.3 85 1 / 2

Bitmap Index Scan on backlog_tsv_filtered_idx (cost=0.00..1,169.76 rows=1,301 width=0) (actual time=4.638..4.638 rows=85 loops=1)

  • Index Cond: (tsv @@ '''sexualis'''::tsquery)
11. 0.159 0.424 ↑ 1.0 675 2 / 2

Hash (cost=115.69..115.69 rows=675 width=17) (actual time=0.424..0.424 rows=675 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 42kB
12. 0.265 0.265 ↑ 1.0 675 2 / 2

Seq Scan on buffer (cost=0.00..115.69 rows=675 width=17) (actual time=0.009..0.265 rows=675 loops=2)

  • Filter: (userid = 2)
  • Rows Removed by Filter: 122
13. 0.016 0.054 ↑ 1.0 33 2 / 2

Hash (cost=7.70..7.70 rows=33 width=45) (actual time=0.054..0.054 rows=33 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
14. 0.010 0.038 ↑ 1.0 33 2 / 2

Nested Loop (cost=0.00..7.70 rows=33 width=45) (actual time=0.028..0.038 rows=33 loops=2)

15. 0.010 0.010 ↑ 1.0 1 2 / 2

Function Scan on query (cost=0.00..0.10 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=2)

16. 0.018 0.018 ↑ 1.0 33 2 / 2

Seq Scan on network (cost=0.00..4.30 rows=33 width=13) (actual time=0.015..0.018 rows=33 loops=2)

17. 28.643 28.643 ↑ 1.0 1 45 / 2

Index Scan using sender_pkey on sender (cost=0.43..8.21 rows=1 width=55) (actual time=1.273..1.273 rows=1 loops=45)

  • Index Cond: (senderid = backlog.senderid)
Planning time : 2.968 ms
Execution time : 677.899 ms