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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Datomic Implicit Partitions

38 点作者 xmlblog大约 2 年前

2 条评论

hlship大约 2 年前
Like any database, Datomic often needs to perform queries by reading data from its indexes. In fact, in Datomic, all data is stored in indexes - there aren&#x27;t rows with indexes pointing to the rows, just indexes.<p>Datomic uses any of a number of stores, typically something like DynamoDB, to persist this index data.<p>When performing a query, Datomic peers read directly from the store (or from a cache) and read an entire block of index data as a single unit - each such block effectively contains many entity&#x2F;attribute&#x2F;value&#x2F;transaction Datoms sorted by entity, attribute, or value, depending on which index is being scanned.<p>In other words, when reading all the attributes for entity X, Datomic will read from storage the block containing X, but also must inadvertently read other data that precedes or follows X.<p>The partitioning business is to ensure that related entities are stored close to each other; literally, a block of bits within the 64 bit entity id is set to the partition value. This ensures that the Datoms for related entities are stored close to each other, which in turn, ensures that the query can be satisfied using fewer of these index blocks, read from cache or storage, than if the entire entity id was arbitrary. Essentially, if entity X and entity Y are related, they can share a partition, and most likely will be stored together in a single index block.<p>This co-location of data can make a big difference in very large Datomic databases.
unixhero大约 2 年前
Does Postgres have this?
评论 #35667994 未加载
评论 #35667301 未加载