docs: the section 8 parallel Scan example differs from the statement scan_impl emits, and its portability note repeats two lines

未关闭 适合新手
#1,413 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
88/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
postgresql, rust, sql

调研方向

从 docs/design/04-component-storage.md 第 8 节的第 776 至 804 行开始,将其中段 2 的 SQL 与 crates/storage-postgres/src/data/query_scan.rs 中 scan_impl 生成的谓词和 ORDER BY 进行比较。完成标准是示例使用生成的谓词和 COLLATE "C" 排序,并删除重复的可移植性说明行。没有指定测试,因此请通过肉眼检查渲染后的 Markdown。

由索引模型根据 Issue 内容生成。

描述

docs/design/04-component-storage.md, section 8, "Parallel Scan Segment Assignment" (lines 776 to 804 on main at 44cd43667), shows this statement for segment 2 of 4:

SELECT item_data FROM _ddb_Users
WHERE (hashtext(pk)::bigint & x'7FFFFFFF'::bigint) % 4 = 2
ORDER BY pk, sk_s
LIMIT $limit;

scan_impl in crates/storage-postgres/src/data/query_scan.rs emits (hashtext(pk)::bigint & 2147483647) % 4 = 2 for the segment predicate, and ORDER BY pk, sk_s COLLATE "C" for a base table with a string sort key. The mask has the same value in both forms, and the COLLATE "C" is the byte order the doc describes in section 5.1. The texts differ.

The portability note that follows ends with two lines that repeat the end of the sentence before them:

> hash function in the `core` crate (e.g., CRC32 of the partition key bytes)
> that all backends use, and pass the pre-computed segment filter to the
> storage backend.
> crate (e.g., CRC32 of the partition key bytes) that all backends use, and pass the pre-computed segment filter to the
> storage backend.

Proposed change: copy the emitted predicate and ORDER BY into the example, and remove the two repeated lines.

主要语言
Rust
星标
517
派生
60
平均合并
3 天 21 小时
30 天内合并 PR
116

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ExtendDB/extenddb 的其他 Issue

查看 ExtendDB/extenddb 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。