-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[opt] merge filters on composite primary keys in plan (1.2-dev) #16693
Conversation
…6510) (a,b,c) are composite keys a=? and b in (?,?...) ==> __mo_cpkey_col prefix_in (?,?...) a=? and b = ? and c in (?,?...) ==> __mo_cpkey_col in (?,?...) Approved by: @m-schen, @badboynt1, @XuPeng-SH, @ouyuanning
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Review 🔍
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Code Suggestions ✨
|
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue #16146
What this PR does / why we need it:
(a,b,c) are composite keys
a=? and b in (?,?...) ==> __mo_cpkey_col prefix_in (?,?...) a=? and b = ? and c in (?,?...) ==> __mo_cpkey_col in (?,?...)
PR Type
Enhancement, Bug fix
Description
in
andnot_in
functions to safely cast expressions.T_tuple
.in
andprefix_in
functions.Changes walkthrough 📝
13 files
apply_indices.go
Enhance expression handling and function binding in apply indices.
pkg/sql/plan/apply_indices.go
isRuntimeConstExpr
.bindFuncExprAndConstFold
withBindFuncExprImplByPlanExpr
forprefix_between
andprefix_in
.base_binder.go
Improve handling of `in` and `not_in` functions in base binder.
pkg/sql/plan/base_binder.go
in
andnot_in
functions to safely cast expressions.in
andnot_in
functions.build_insert.go
Update type assignment for `in` expressions in build insert.
pkg/sql/plan/build_insert.go
in
expressions to match primary keyexpression type.
expr_opt.go
Enhance merging of filters on composite keys in expression
optimization.
pkg/sql/plan/expr_opt.go
in
expressions.
func_get_admin.go
Change admin name retrieval to use byte slices.
pkg/sql/plan/function/func_get_admin.go
list_operator.go
Update supported operators to use specific types.
pkg/sql/plan/function/list_operator.go
T_tuple
.make.go
Update vector creation functions to use specific types.
pkg/sql/plan/make.go
T_tuple
.partition_list.go
Add constant folding for partition expressions.
pkg/sql/plan/partition_list.go
query_builder.go
Move mergeFiltersOnCompositeKey call to earlier stage in query
creation.
pkg/sql/plan/query_builder.go
mergeFiltersOnCompositeKey
call to an earlier stage in querycreation.
runtime_filter.go
Update type handling for runtime filters.
pkg/sql/plan/runtime_filter.go
instead of
T_tuple
.stats.go
Improve selectivity estimation for `in` and `prefix_in` functions.
pkg/sql/plan/stats.go
in
andprefix_in
functions.utils.go
Update MakeInExpr to use specific types.
pkg/sql/plan/utils.go
MakeInExpr
to use specific types instead ofT_tuple
.util.go
Update type assignment for primary key expressions.
pkg/vm/engine/disttae/util.go
types instead of
T_tuple
.3 files
build_constraint_util.go
Fix typo in function name in build constraint utility.
pkg/sql/plan/build_constraint_util.go
appendPrimaryConstrantPlan
toappendPrimaryConstraintPlan
.build_dml_util.go
Fix typo in function name in build DML utility.
pkg/sql/plan/build_dml_util.go
appendPrimaryConstrantPlan
toappendPrimaryConstraintPlan
.constant_fold.go
Fix retrieval of string values in constant folding.
pkg/sql/plan/rule/constant_fold.go
1 files
util_test.go
Update test cases for primary key expression type assignment.
pkg/vm/engine/disttae/util_test.go
key expressions.