Repository navigation
Closed
Labels
kind/bugSomething isn't workingseverity/s0Active / top priority for current sprint. Owner has committed to working on it now.
Milestone
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main, 3.0-dev
Commit ID
latest
Other Environment Information
- Hardware parameters:
- OS type:
- Others:Actual Behavior
drop database if exists test;
create database test
use test;
create table t0(a int, b int, c int, primary key(a, b));
insert into t0 select *,*,* from generate_series(1, 1000*1000*10)g;
select t0.* from t0 join (values row(1,1),row(2,2),row(3,3)) as pks(a,b) on t0.a=pks.a and t0.b=pks.b;
plan:
explain analyze select t0.* from t0 join (values row(1,1),row(2,2),row(3,3)) as pks(a,b) on t0.a=pks.a and t0.b=pks.b;
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ap query plan on multicn(12 core) |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Project |
| Analyze: timeConsumed=1ms waitTime=354ms inputRows=3 outputRows=3 (min=3, max=3) InputSize=36 bytes OutputSize=36 bytes MemorySize=36 bytes (min=0 bytes, max=36 bytes) |
| -> Join |
| Analyze: timeConsumed=243ms probe_time=[total=243ms,min=16ms,max=31ms,dop=12] build_time=[0ms] waitTime=0ms inputRows=10000003 outputRows=3 (min=0, max=3) InputSize=114.44 MiB OutputSize=36 bytes MemorySize=833.77 KiB (min=64.13 KiB, max=64.18 KiB) |
| Join Type: INNER |
| Join Cond: (cast(t0.a AS BIGINT) = pks.a), (cast(t0.b AS BIGINT) = pks.b) |
| -> Table Scan on test.t0 |
| Analyze: timeConsumed=3220ms scan_time=[total=3220ms,min=160ms,max=335ms,dop=12] waitTime=0ms inputBlocks=1221 inputRows=10000000 outputRows=10000000 (min=824960, max=835584) InputSize=114.44 MiB OutputSize=114.44 MiB MemorySize=2.25 MiB (min=192.00 KiB, max=192.00 KiB) |
| -> Project |
| Analyze: timeConsumed=0ms waitTime=0ms inputRows=3 outputRows=3 (min=3, max=3) InputSize=48 bytes OutputSize=48 bytes MemorySize=48 bytes (min=48 bytes, max=48 bytes) |
| -> Values Scan "*VALUES*" |
| Analyze: timeConsumed=0ms waitTime=0ms inputRows=3 outputRows=3 (min=3, max=3) InputSize=48 bytes OutputSize=48 bytes MemorySize=0 bytes (min=0 bytes, max=0 bytes) |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
12 rows in set (0.36 sec)
Expected Behavior
No response
Steps to Reproduce
see Actual BehaviorAdditional information
No response
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingseverity/s0Active / top priority for current sprint. Owner has committed to working on it now.
Activity
Ariznawlll commentedon Aug 25, 2026
测试版本
原问题验证
构造 100 万行复合主键表并与小型 inline 表按完整主键连接。连续 3 个独立轮次中,结果与精确主键集合一致;`EXPLAIN ANALYZE` 均显示 Runtime Filter Build,并在 `t0.__mo_cpkey_col` 上 Probe。
Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
已在 `pkg/sql/plan` 连续 3 轮执行 `TestGenerateRuntimeFilters`、`TestAnalyzeRuntimeFilterJoinPolicy`、`TestForceJoinOnOneCNRuntimeFilterPolicy`,均通过,覆盖 planner 的 Runtime Filter 生成和 join policy。
回归测试
回归位于 MatrixOne planner 单元测试 `pkg/sql/plan`;此问题的关键是优化器决策,白盒计划用例比固化物理计划的 motr 更稳定。100 万行实测已覆盖规模门槛,不需要额外大数据量测试。
测试证据
测试结论
测试通过。
fix: add composite primary key runtime filters (cherry-pick #27501) (#…