学习join查询时我的doris 1.2.6不使用bucket shuffle join问题

Viewed 45

我在学习bucket shuffle join时新建了两张测试表studnet和teacher
CREATE TABLE student (
ID int(11) NULL,
NAME varchar(255) NULL
) ENGINE = OLAP DUPLICATE KEY(ID) COMMENT 'OLAP' DISTRIBUTED BY HASH(ID) BUCKETS 3 PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2",
"disable_auto_compaction" = "false"
);
CREATE TABLE teacher (ID int(11) NULL, NAME varchar(255) NULL) ENGINE = OLAP DUPLICATE KEY(ID) COMMENT 'OLAP' DISTRIBUTED BY HASH(ID) BUCKETS 3 PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2",
"disable_auto_compaction" = "false"
);
它们都使用ID作为分桶键,在执行join语句select student.ID,teacher.NAME from student left join teacher on student.ID = teacher.ID时on条件两边都使用了分桶键,根据文档上说的似乎应该使用bucket shuffle join,但是我在explain这个join语句时发现它使用的是BROADCAST,请问下这是为什么?如何让它使用bucket shuffle join?

1 Answers

set global enable_bucket_shuffle_join = true; 执行下这个
image.png