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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Reducing Online Serving Latency from 1.11s to 123.6ms

39 点作者 jinqueeny超过 2 年前

4 条评论

daneel_w超过 2 年前
Something the author(s) don&#x27;t seem to fully consider when creating composite indices is how B-trees work. The leanest and almost always fastest composite index for MariaDB&#x2F;MySQL is one where the columns are ordered first to last relative to lowest and highest <i>cardinality</i>, i.e. how divergent they are. You <i>usually</i> want a B-tree index that&#x27;s as little branchy as possible in the start, and then branches out increasingly the deeper into it you get, in order to traverse its components as fast as possible. The performance difference between a correctly ordered composite index and one that&#x27;s ordered seemingly on random, as in the article, can be not-insignificant.
评论 #34378869 未加载
ngaut超过 2 年前
Keeping low latency for an online data service with more than 5 billion records can be a challenge. Features like query the database with natural language(<a href="https:&#x2F;&#x2F;ossinsight.io&#x2F;explore).This" rel="nofollow">https:&#x2F;&#x2F;ossinsight.io&#x2F;explore).This</a> makes it easier for users to access the data without having to know SQL. But the generate SQL could be pretty heavy(many Full table scan and index scan).
评论 #34376335 未加载
mayli超过 2 年前
Shouldn&#x27;t this be some common sense?
评论 #34375917 未加载
andrejguran超过 2 年前
TLDR: indexes make your DB go BRrrrrr