TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Reducing Online Serving Latency from 1.11s to 123.6ms

39 pointsby jinqueenyover 2 years ago

4 comments

daneel_wover 2 years ago
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 未加载
ngautover 2 years ago
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 未加载
mayliover 2 years ago
Shouldn&#x27;t this be some common sense?
评论 #34375917 未加载
andrejguranover 2 years ago
TLDR: indexes make your DB go BRrrrrr