TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Is there a datastructure for leaderboards with filtering and timeslices?

2 点作者 JoeOfTexas6 个月前
I built a variation of B+Tree to track leaderboard rankings and it works similar to Redis Z functions (zadd&#x2F;zrange).<p>Now I&#x27;m trying to think of a solution to filter by country code or some other player attribute. In addition, I also want to dynamically create timeslices so I can show leaderboard rankings that occurred between time A and time B.<p>If I were to implement the filter or timeslices into my B+Tree, I&#x27;d have to basically scan from the first record down to the last by checking against player attributes and&#x2F;or the timestamp of when ranking was inserted.<p>The goal is to have 1 leaderboard index per stat, rather than X leaderboard per stat.<p>Is it feasible, or should I just create a new leaderboard index for every combination of attribute &#x2F; timeslice?

1 comment

solardev6 个月前
Are you at the scale where a simple database table and a few queries can&#x27;t solve this?<p>Maybe I&#x27;m misunderstanding something, but if it&#x27;s just a few thousand&#x2F;tens of thousands of entries, it seems like the kind of thing any SQL can do pretty effortlessly...?
评论 #42056064 未加载