sbtest1\sbtest2\sbtest4在一个表组里,并且他们的日志流leader都在一个ob server上,但是为什么我下面的sql的执行计划还是分布式执行计划?
mysql> EXPLAIN EXTENDED select count(*) from sbtest1 t1, sbtest2 t2, sbtest3 t4 where
t1.id=t2.id and t1.id=t4.id and t1.k<>t2.k and t1.k<>t4.k;
±----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Query Plan |
±----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ============================================================= |
| |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| |
| ------------------------------------------------------------- |
| |0 |SCALAR GROUP BY | |1 |188204 | |
| |1 |└─HASH JOIN | |99989 |186392 | |
| |2 | ├─PX COORDINATOR | |99995 |147159 | |
| |3 | │ └─EXCHANGE OUT DISTR |:EX10000|99995 |109081 | |
| |4 | │ └─MERGE JOIN | |99995 |23675 | |
| |5 | │ ├─TABLE FULL SCAN|t1 |100000 |5483 | |
| |6 | │ └─TABLE FULL SCAN|t2 |100000 |5483 | |
| |7 | └─TABLE FULL SCAN |t4 |100000 |5483 | |
| ============================================================= |
Outputs & filters: |
---|
0 - output([T_FUN_COUNT(*)(0x7f6b3cc28da0)]), filter(nil), rowset=256 |
group(nil), agg_func([T_FUN_COUNT(*)(0x7f6b3cc28da0)]) |
1 - output(nil), filter(nil), rowset=256 |
equal_conds([t1.id(0x7f6b3cc23500) = t4.id(0x7f6b3cc251c0)(0x7f6b3cc248f0)]), other_conds([t1.k(0x7f6b3cc26a30) != t4.k(0x7f6b3cc286f0)(0x7f6b3cc27e20)]) |
2 - output([t1.id(0x7f6b3cc23500)], [t1.k(0x7f6b3cc26a30)]), filter(nil), rowset=256 |
3 - output([t1.id(0x7f6b3cc23500)], [t1.k(0x7f6b3cc26a30)]), filter(nil), rowset=256 |
is_single, dop=1 |
4 - output([t1.id(0x7f6b3cc23500)], [t1.k(0x7f6b3cc26a30)]), filter(nil), rowset=256 |
equal_conds([t1.id(0x7f6b3cc23500) = t2.id(0x7f6b3cc23950)(0x7f6b3cc22c30)]), other_conds([t1.k(0x7f6b3cc26a30) != t2.k(0x7f6b3cc26e80)(0x7f6b3cc26160)]) |
merge_directions([ASC]) |
5 - output([t1.id(0x7f6b3cc23500)], [t1.k(0x7f6b3cc26a30)]), filter(nil), rowset=256 |
access([t1.id(0x7f6b3cc23500)], [t1.k(0x7f6b3cc26a30)]), partitions(p0) |
is_index_back=false, is_global_index=false, |
range_key([t1.id(0x7f6b3cc23500)]), range(MIN ; MAX)always true |
6 - output([t2.id(0x7f6b3cc23950)], [t2.k(0x7f6b3cc26e80)]), filter(nil), rowset=256 |
access([t2.id(0x7f6b3cc23950)], [t2.k(0x7f6b3cc26e80)]), partitions(p0) |
is_index_back=false, is_global_index=false, |
range_key([t2.id(0x7f6b3cc23950)]), range(MIN ; MAX)always true |
7 - output([t4.id(0x7f6b3cc251c0)], [t4.k(0x7f6b3cc286f0)]), filter(nil), rowset=256 |
access([t4.id(0x7f6b3cc251c0)], [t4.k(0x7f6b3cc286f0)]), partitions(p0) |
is_index_back=false, is_global_index=false, |
range_key([t4.id(0x7f6b3cc251c0)]), range(MIN ; MAX)always true |
Used Hint: |
------------------------------------- |
/*+ |
*/ |
Qb name trace: |
------------------------------------- |
stmt_id:0, stmt_type:T_EXPLAIN |
stmt_id:1, SEL$1 |
Outline Data: |
------------------------------------- |
/*+ |
BEGIN_OUTLINE_DATA |
LEADING(@“SEL$1” ((“t1”@“SEL$1” “t2”@“SEL$1”) “t4”@“SEL$1”)) |
USE_HASH(@“SEL$1” “t4”@“SEL$1”) |
PQ_DISTRIBUTE(@“SEL$1” “t4”@“SEL$1” LOCAL LOCAL) |
USE_MERGE(@“SEL$1” “t2”@“SEL$1”) |
FULL(@“SEL$1” “t1”@“SEL$1”) |
FULL(@“SEL$1” “t2”@“SEL$1”) |
FULL(@“SEL$1” “t4”@“SEL$1”) |
OPTIMIZER_FEATURES_ENABLE(‘4.3.3.0’) |
END_OUTLINE_DATA |
*/ |
Optimization Info: |
------------------------------------- |
t1: |
table_rows:100000 |
physical_range_rows:100000 |
logical_range_rows:100000 |
index_back_rows:0 |
output_rows:100000 |
table_dop:1 |
dop_method:Table DOP |
avaiable_index_name:[k_1, sbtest1] |
pruned_index_name:[k_1] |
stats info:[version=2025-07-02 20:11:18.265391, is_locked=0, is_expired=0] |
dynamic sampling level:0 |
estimation method:[OPTIMIZER STATISTICS, STORAGE] |
t2: |
table_rows:100000 |
physical_range_rows:100000 |
logical_range_rows:100000 |
index_back_rows:0 |
output_rows:100000 |
table_dop:1 |
dop_method:Table DOP |
avaiable_index_name:[k_2, sbtest2] |
pruned_index_name:[k_2] |
stats info:[version=2025-07-18 22:00:03.252737, is_locked=0, is_expired=0] |
dynamic sampling level:0 |
estimation method:[OPTIMIZER STATISTICS, STORAGE] |
t4: |
table_rows:100000 |
physical_range_rows:100000 |
logical_range_rows:100000 |
index_back_rows:0 |
output_rows:100000 |
table_dop:1 |
dop_method:Table DOP |
avaiable_index_name:[k_3, sbtest3] |
pruned_index_name:[k_3] |
stats info:[version=2025-03-26 02:12:34.429561, is_locked=0, is_expired=0] |
dynamic sampling level:0 |
estimation method:[OPTIMIZER STATISTICS, STORAGE] |
Plan Type: |
DISTRIBUTED |
Note: |
Degree of Parallelisim is 1 because of table property |
±----------------------------------------------------------------------------------------------------------------------------------------------------------------+
104 rows in set (0.06 sec)
mysql>
【 使用环境 】生产环境 or 测试环境
【 OB or 其他组件 】
【 使用版本 】
【问题描述】清晰明确描述问题
【复现路径】问题出现前后相关操作
【附件及日志】推荐使用OceanBase敏捷诊断工具obdiag收集诊断信息,详情参见链接(右键跳转查看):
【备注】基于 LLM 和开源文档 RAG 的论坛小助手已开放测试,在发帖时输入 [@论坛小助手] 即可召唤小助手,欢迎试用!