已合并
add the index parallel scannning function #9321
add the index parallel scannning function #9321
已合并
xiahanzhi创建于 6月15日
xiahanzhi
6月15日

【标题】(请简要描述下实现的内容)
实现索引扫描SMP

【实现内容】:
实现索引扫描SMP

【根因分析】:

【实现方案】:
二阶段扫描,第一阶段划分范围,第二阶段按划分范围扫描

【关联需求或issue】:

【开发自验报告】:

  1. 请附上自验结果(内容或者截图)
    image.png
    image.png
    image.png
    image.png
    image.png
  2. 是否可以添加fastcheck测试用例,如是,请补充fastcheck用例
    image.png
  3. 是否涉及资料修改,如是,在docs仓库补充资料
    索引SMP资料
  4. 是否考虑升级场景(系统表修改、日志持久化以及修改执行态数据格式)
    不涉及
  5. 是否考虑在线扩容等扩展场景
    不涉及
  6. 是否考虑异常场景/并发场景/前向兼容/性能场景
    不涉及
  7. 是否对其他模块产生影响
    不涉及
  8. 是否需要回合补丁版本(5.0、6.0),涉及(结果错误|coredump|性能劣化|内存泄露|集群异常)相关修复请排查回合补丁分支
    不涉及
  9. 针对Plugin仓dolphin插件,新增/修改的代码是否已使用 DOLPHIN 宏进行控制,方便后续回合openGauss-server仓代码
    不涉及

【其他说明】:
覆盖率
image.png

likedislike
Pull Request已成功合入, 合并人@opengauss_bot
(感谢 xiahanzhi 的贡献)
opengauss_botopengauss_bot成员
6月15日 添加了label:sig/StorageEnginesig/SQLEnginesig/SecurityTechnologysig/CMsig/CloudNativesig/AI
opengauss_bot
opengauss_bot成员
6月15日 评论:

Welcome To openGauss Community

Hey @x00510761 , 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: StorageEngine, AI, CM, CloudNative, SecurityTechnology, SQLEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @ywzq1161327784 ,
and any of the committers: @Igali, @bihua111, @cailei19, @h_ray, @levy53071, @libiao2024, @lihaixiao, @mrzack, @wangfeihuo, @wuyuechuan, @xiong_xjun, @zhangfengzhi123, @zhangxubo, @zjh_hw .

likedislike
opengauss_botopengauss_bot成员
6月15日 添加了label:codecheck-running
opengauss_botopengauss_bot成员
6月15日 添加了label:opengauss-cla/no
opengauss_botopengauss_bot成员
6月15日 添加了label:needs-issue
此处折叠了363条消息 查看更多
opengauss_bot
opengauss_bot成员
7月14日 评论:

开源片段扫描

Check Name Build Details Check Result Check Detail
sca #38844 ✅ 通过 >>>
likedislike
opengauss_bot
opengauss_bot成员
7月14日 评论:

静态检查

Check Name Build Details Check Result Check Detail
CodeCheck #77654 ✅ 通过 >>>
likedislike
opengauss_botopengauss_bot成员
7月14日 添加了label:codecheck-success
opengauss_botopengauss_bot成员
7月14日 删除了label:codecheck-running
Anderles9月9日进行代码检视1
src/gausskernel/storage/access/nbtree/nbtsearch_parallel.cpp
@@ -0,0 +202,4 @@
202+ errmsg("missing support function %d(%u,%u) for attribute %d of index \"%s\"",
203+ BTORDER_PROC, bt_rel->rd_opcintype[i], cur->sk_subtype, cur->sk_attno,
204+ RelationGetRelationName(bt_rel))));
205+ ScanKeyEntryInitialize(inskey->scankeys + i, cur->sk_flags, cur->sk_attno, InvalidStrategy, cur->sk_subtype,
Anderles9月9日评论:

这里的 ScanKeyEntryInitialize 可能不应只放在else分支。
当索引键为 int8、查询键为 int4 时,if分支仅设置cmp_proc = F_BTINT84CMP,随后绕过本行,导致inskey->scankeys[i] 未初始化。后续 B-tree 比较使用sk_attno 调用 index_getattr(),会触发断言失败。附本地复现用例:

CREATE TABLE smp_int84_min (k int8 NOT NULL);
INSERT INTO smp_int84_min VALUES (1);
CREATE INDEX smp_int84_min_k_idx ON smp_int84_min(k);
ANALYZE smp_int84_min;

SET query_dop = 3;
SET enable_force_smp = on;
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_indexonlyscan = off;
SET enable_bitmapscan = off;

EXPLAIN (COSTS OFF)
SELECT count(*) FROM smp_int84_min WHERE k >= 1;

SELECT count(*) FROM smp_int84_min WHERE k >= 1;

likedislike