PostgreSQL: index for the AT_TIMESTAMP stream seek needs a data migration
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reading the existing data migration files under crates/storage-postgres/data_migrations/ and the migrations::DATA_MIGRATIONS list. Add a migration for the covering (shard_id, created_at, sequence_number) index, then update the catalog-converge and backup tests that enumerate migrations. Done when those tests include the migration and existing deployments can run extenddb migrate before serving the upgraded binary.
由索引模型根据 Issue 内容生成。
描述
The AT_TIMESTAMP seek on PostgreSQL runs SELECT MIN(sequence_number) FROM stream_records WHERE shard_id = $1 AND created_at >= $2. The planner takes the minimum off the (shard_id, sequence_number) primary key and applies created_at as a heap filter; the global created_at index cannot yield the minimum sequence without a sort, so it is not chosen. With sequence and creation time correlated, a seek near the tip filters the whole shard.
Measured on one shard of 100,000 records with created_at spread over 24 hours: a seek at the start answers in 0.04 ms (first row qualifies), a mid-range seek in 9.46 ms (49,999 rows removed by filter), a seek near the tip in 19.21 ms (99,899 rows removed). Linear in shard size beyond that.
A covering index (shard_id, created_at, sequence_number) gives the minimum directly. It needs a data migration file under crates/storage-postgres/data_migrations/ and an entry in migrations::DATA_MIGRATIONS, which means existing deployments run extenddb migrate before the upgraded binary serves, and the catalog-converge and backup tests that enumerate the migration list need the new file added. That upgrade step is why the index is not part of the feature change; GetShardIterator runs about once per consumer resume, so the cost is tolerable until a hot shard holds millions of records.
MongoDB and SQLite got their (shard_id, created_at) index in the feature change itself, since both create indexes idempotently at startup.
- 主要语言
- Rust
- 星标
- 517
- 派生
- 60
- 平均合并
- 2 天 23 小时
- 30 天内合并 PR
- 25
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ExtendDB/extenddb 的其他 Issue
-
backend:mongodb bug
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 2 天内回复
-
backend:cassandra bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 2 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 2 天内回复
-
backend:cassandra bug
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 2 天内回复
-
[storage.cassandra] accepts unknown keys silently可能已有人在做 @LeeroyHannigan 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
ExtendDB/extenddb#540 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 ExtendDB/extenddb 的全部 Issue
相似的 Issue
-
desktop documentation
难度 1/5 1 小时以内 新手友好度 90/100
vfarcic/dot-agent-deck#2008 ·
维护者通常 1 天内回复
-
needs triage
难度 1/5 1 小时以内 新手友好度 85/100
pbakaus/impeccable#1210 ·
维护者通常 1 天内回复
-
enhancement ux-opportunities
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area: ci priority: P4 ready-for-agent
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
`PartialEq` for `AssignedBigUint` treats different values as equal可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭status:untriaged
难度 2/5 1-3 小时 新手友好度 78/100
midnightntwrk/midnight-zk#600 ·
维护者通常 2 天内回复