已合并
优化索引扫描性能 #8094
优化索引扫描性能 #8094
已合并
totaj创建于 2025年7月18日
totaj
totaj成员
2025年7月18日

【标题】(请简要描述下实现的内容)
优化索引扫描性能
【实现内容】:
优化索引扫描性能
【根因分析】:
优化索引扫描性能
【实现方案】:

  1. 对于只读事务,在处理sync message时,暂时不提交事务,延迟到下次消息提交,提升只读事务的性能。暂时通过 enable_beta_features 来控制该功能。
  2. 对于btree index扫描,减少GET_REL_PROCEDURE的fmgr耗时,通过直接调用对应函数来减少调用路径,同时部分场景直接去掉 enable_indexscan_optimization 控制,默认开启相关优化
  3. 优化btree二分查找的效率,通过模版函数增加bool参数,减少分支判断次数
  4. _bt_check_natts_correct 检测索引正确性通过 enable_indexscan_optimization 控制,打开时跳过相关检测
  5. pg_checksum_block函数通过编译优化,开启循环展开、自动向量化,提升性能

【关联需求或issue】:
https://gitcode.com/opengauss/Plugin/issues/1521

【开发自验报告】:

  1. 请附上自验结果(内容或者截图)
    都是较小的优化,减少一些计算和分支判断,对整体性能影响较小,难以通过测试发现提升,故不提供截图
  2. 是否可以添加fastcheck测试用例,如是,请补充fastcheck用例
    否,小性能优化,对外表现无变化
  3. 是否涉及资料修改,如是,在docs仓库补充资料
    不涉及
  4. 是否考虑升级场景(系统表修改、日志持久化以及修改执行态数据格式)
    不涉及
  5. 是否考虑在线扩容等扩展场景
    不涉及
  6. 是否考虑异常场景/并发场景/前向兼容/性能场景
    不涉及
  7. 是否对其他模块产生影响
    不涉及
  8. 是否需要回合补丁版本(5.0、6.0),涉及(结果错误|coredump|性能劣化|内存泄露|集群异常)相关修复请排查回合补丁分支
    不涉及

【其他说明】:

likedislike
Pull Request已成功合入, 合并人@opengauss_bot
(感谢 totaj 的贡献)
totajtotaj成员
2025年7月18日 创建了 pull request,commit 70ed67d5
opengauss_botopengauss_bot成员
2025年7月18日 添加了label:sig/Community
opengauss_bot
opengauss_bot成员
2025年7月18日 评论:

Welcome To openGauss Community

Hey @totaj , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: Community ,
and any of the committers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @libiao2024, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wangfeihuo, @ywzq1161327784, @zhangfengzhi123 .

likedislike
opengauss_botopengauss_bot成员
2025年7月18日 添加了label:opengauss-cla/yes
opengauss_botopengauss_bot成员
2025年7月18日 添加了label:codecheck-running
此处折叠了125条消息 查看更多
opengauss_bot
opengauss_bot成员
2025年7月19日 评论:

Review Code Feedback

  • The label lgtm-wangfeihuo was added to this pull request. It means that wangfeihuo reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
opengauss_botopengauss_bot成员
2025年7月19日 合入了pull request,合并节点 SHA:894d1d320c7b0544025c3fc842702d51f9033f06
opengauss_botopengauss_bot成员
2025年7月19日 删除了label:codecheck-success
opengauss_bot
opengauss_bot成员
2025年7月19日 评论:

开源片段扫描

Check Name Build Details Check Result Check Detail
sca #22581 ✅ 通过 >>>
likedislike
opengauss_bot
opengauss_bot成员
2025年7月19日 评论:

静态检查

Check Name Build Details Check Result Check Detail
CodeCheck #53198 ✅ 通过 >>>
likedislike