已关闭
[Bug]: 用例未走hash join查询速度较慢 #341
hcs创建于  8月24日关闭于  20 天前
hcs
hcs成员
8月24日 创建

测试类型

SQL功能

测试版本

7.0.0LTS

问题描述

用例在v3走了hashjoin,ograc走的nestloop

操作系统和硬件信息

任意

测试环境

oGRAC单节点

被测功能

预置条件

操作步骤

用例:Hash_join/Hash_join_compare/tc_dss_hash_join_compare_000

-- 1. 创建表:保留宽行,模拟原用例的大字段访问成本
drop table if exists qz_left cascade CONSTRAINTS;
drop table if exists qz_dup cascade CONSTRAINTS;
drop table if exists qz_right cascade CONSTRAINTS;

create table qz_left(k int, pad varchar2(1000));
create table qz_dup(k int, pad varchar2(1000));
create table qz_right(k int, pad varchar2(1000));

create index qz_left_k_idx on qz_left(k);
create index qz_dup_k_idx on qz_dup(k);
create index qz_right_k_idx on qz_right(k);

-- 2. 插入数据:qz_dup 生成 1000000 行,并让连接键大量重复
insert into qz_left values(1,rpad('L',1000,'L'));
insert into qz_left values(2,rpad('L',1000,'L'));
insert into qz_left values(3,rpad('L',1000,'L'));
insert into qz_left values(4,rpad('L',1000,'L'));
insert into qz_left values(5,rpad('L',1000,'L'));
insert into qz_left values(6,rpad('L',1000,'L'));
insert into qz_left values(7,rpad('L',1000,'L'));
insert into qz_left values(8,rpad('L',1000,'L'));
insert into qz_left values(9,rpad('L',1000,'L'));
insert into qz_left values(10,rpad('L',1000,'L'));
insert into qz_right select k,rpad('R',1000,'R') from qz_left;
insert into qz_dup select a.k,rpad('D',1000,'D') from qz_left a,qz_left b,qz_left c,qz_left d,qz_left e,qz_left f;
commit;

-- 3. 查询
explain select count(*) from qz_left a left join qz_dup b on a.k=b.k right join qz_right c on a.k=c.k;

select systimestamp as select_start_time;
set timing on
select count(*) from qz_left a left join qz_dup b on a.k=b.k right join qz_right c on a.k=c.k;
set timing off
select systimestamp as select_end_time;

预期输出

实际输出

NESTED LOOPS

日志信息

image.png

image.png

提单组织

内部开发

测试代码

likedislike
hcshcs成员
8月24日 添加了label:bug
opengauss_bot
opengauss_bot成员
8月24日 评论:

This issue requires an assignee. Since you haven't specified one, we've assigned TestManager as the default assignee for this issue.

likedislike
opengauss_botopengauss_bot成员
8月24日 将 TestManager 设为负责人
opengauss_botopengauss_bot成员
8月24日 添加了label:sig/StorageEngine
hcshcs成员
8月24日 关联了看板:临时看板
opengauss_bot
opengauss_bot成员
8月24日 评论:

Welcome To openGauss Community

Hey @Nerifish , 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. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.

Contact Guide

If you have any questions, please contact the SIG: StorageEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @CityYard, @libiao2024, @lijieac, @theothersideofsea, @wang_bowen, @weithu, @xiong_xjun, @yuanyazhi, @zhangzq131 .

likedislike
hcshcs成员
8月25日 修改了issue 的描述
hcshcs成员
28 天前 关联了pull request:修复hashjoin相关问题
chendong76chendong76成员
28 天前 关联了看板:openGauss 7.0.0-LTS
chendong76chendong76成员
28 天前 移除了看板:临时看板
hcshcs成员
27 天前 将 Nerifish 设为负责人
hcshcs成员
27 天前 移除了负责人 TestManager
hcs
hcs成员
26 天前 评论:

image.png
image.png
image.png

likedislike
hcshcs成员
26 天前 issue状态由 待办的 改变为 待回归
陈博达
陈博达成员
21 天前 评论:

【回归日期】20260907

【回归人员】陈博达

【回归结论】通过

测试结果

image.png

image.png

likedislike
liuzhen001liuzhen001成员
20 天前 issue状态由 待回归 改变为 已验收
liuzhen001liuzhen001成员
20 天前 关闭了 issue