🧪 test(metadata): 对齐 SQLite 自增检测基准 - #109
Merged
Merged
Conversation
Owner
Author
|
回归原因:#105 为读取 AUTOINCREMENT 增加了 sqlite_master 查询,固定 benchmark 的 queries_per_call 从 6 变为 7;旧断言因此真实失败。 |
Owner
Author
|
测试调整:更新 benchmark 期望值并让 SQLite ER 测试桩返回 sqlite_master DDL,明确验证表名通过参数绑定传递。 |
Owner
Author
|
文档记录:基准文档现在说明第 7 次往返用于元数据完整性,不把该变化包装为性能提升。 |
Owner
Author
|
验证记录:完整 tests/unit 共 651 项通过;Ruff 检查、格式检查和 diff 检查全部通过。 |
Owner
Author
|
边界说明:本 PR 只同步测试与基准文档,不改变运行时代码;后续性能实验应以 7 次查询为基线。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue
Closes #108
背景(Situation)
#106 为识别 SQLite
AUTOINCREMENT增加了sqlite_masterDDL 查询,describe_table的 SQL 往返从 6 次变为 7 次;旧 benchmark 和可视化测试桩仍假设 6 次,导致回归测试与当前元数据契约不一致。任务(Task)
同步查询次数基线和 SQLite 测试桩,明确新增往返用于自增语义读取;不修改运行时代码或把额外查询描述为性能优化。
行动(Action)
sqlite_master查询。验证(Verification)
环境:Windows 11,Python 3.12.12。
PYTHONPATH=src python -m pytest tests/unit/ -q:651 passed。git diff --check:通过。实验与证据(Evidence)
在固定 SQLite schema 上运行描述 benchmark,
queries_per_call稳定为 7;ER 特殊表名测试确认 DDL 查询表名仍作为参数传入,PRAGMA 标识符保持转义。7 次是完整性成本,不是性能收益。兼容性、风险与回滚