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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

B+ Trees and why I love them, part 1

97 点作者 rayvega将近 12 年前

3 条评论

gtrubetskoy将近 12 年前
I too &quot;discovered&quot; B-Trees (and B+Trees) recently and wrote about it: <a href="http://grisha.org/blog/2013/05/11/relational-database-on-top-of-key-value-store-explained/" rel="nofollow">http:&#x2F;&#x2F;grisha.org&#x2F;blog&#x2F;2013&#x2F;05&#x2F;11&#x2F;relational-database-on-top...</a><p>I even implemented a key&#x2F;value backed SQL database (using Thredis, which is Redis and SQLite) <a href="http://grisha.org/blog/2013/05/29/sqlite-db-stored-in-a-redis-hash/" rel="nofollow">http:&#x2F;&#x2F;grisha.org&#x2F;blog&#x2F;2013&#x2F;05&#x2F;29&#x2F;sqlite-db-stored-in-a-redi...</a><p>SQLite3 has an awesome C implementation with copious comments if you really want to understand them, BTW.<p>The most fascinating thing about B-Trees is that the entire data structure is stored in equally sized blocks (pages), and getting a page by number is a very easy operation in block storage, which is what our RAM and hard drives are (even though back then they were tapes and punch cards).<p>Few people realize that it&#x27;s not just DB&#x27;s that use B-Trees, our filesystems are also largely B-Tree based.<p>It&#x27;s remarkable how few today&#x27;s &quot;developers&quot; understand how they work or even know what they are, yet they are so fundamental to everything computers do.<p>Without B-Trees our present world of computing wouldn&#x27;t exist as we know it. It could be the coolest data structure ever :)
评论 #6228817 未加载
koverstreet将近 12 年前
It should be noted that textbook B+ trees, like those described, are nowhere near state of the art performance wise. It&#x27;s possible to do orders of magnitude better.
评论 #6228549 未加载
评论 #6228547 未加载
rodrigoavie将近 12 年前
This is very awesome. Please consider writing about other tree data structures in the future :)<p>Specially, sofistications on AVL and Red-Black trees