-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[fix](mtmv) Disable sql_limit variable when query rewrite by materialize view #40106
[fix](mtmv) Disable sql_limit variable when query rewrite by materialize view #40106
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
TPC-H: Total hot run time: 38274 ms
|
TPC-DS: Total hot run time: 188309 ms
|
ClickBench: Total hot run time: 32.65 s
|
run buildall |
TPC-H: Total hot run time: 38333 ms
|
TPC-DS: Total hot run time: 194014 ms
|
ClickBench: Total hot run time: 31.76 s
|
run buildall |
TPC-H: Total hot run time: 37721 ms
|
TPC-DS: Total hot run time: 193727 ms
|
ClickBench: Total hot run time: 32.09 s
|
6e7ffe0
to
6703ada
Compare
run buildall |
TPC-H: Total hot run time: 38279 ms
|
TPC-DS: Total hot run time: 187877 ms
|
ClickBench: Total hot run time: 31.86 s
|
6703ada
to
e4abc5f
Compare
run buildall |
@@ -267,7 +269,26 @@ public static Plan rewriteByRules( | |||
CascadesContext rewrittenPlanContext = CascadesContext.initContext( | |||
cascadesContext.getStatementContext(), rewrittenPlan, | |||
cascadesContext.getCurrentJobContext().getRequiredProperties()); | |||
rewrittenPlan = planRewriter.apply(rewrittenPlanContext); | |||
// Tmp old disable rule variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set disable rules here, not everywhere
TPC-H: Total hot run time: 37746 ms
|
TPC-DS: Total hot run time: 193399 ms
|
ClickBench: Total hot run time: 33.07 s
|
run buildall |
TPC-H: Total hot run time: 38420 ms
|
TPC-DS: Total hot run time: 186529 ms
|
ClickBench: Total hot run time: 32.04 s
|
run buildall |
TPC-H: Total hot run time: 38262 ms
|
099376f
to
c0eb449
Compare
run buildall |
run buildall |
run buildall |
run buildall |
@@ -55,6 +57,9 @@ public static ConnectContext createMTMVContext(MTMV mtmv) { | |||
ctx.getState().reset(); | |||
ctx.setThreadLocalInfo(); | |||
ctx.getSessionVariable().allowModifyMaterializedViewData = true; | |||
// Disable add default limit rule to avoid refresh data wrong | |||
ctx.getSessionVariable().setDisableNereidsRules( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the default values are changed in the future, there may be issues here. Can we use an additional method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default value of disableNereidsRules
session should always be empty ''
PR approved by at least one committer and no changes requested. |
…ize view (apache#40106) In BI or some other SQL client,it will set `sql_select_limit` or `default_order_by_limit` session variables automatically. This will make mistake when query rewrite by materialized view, Because after query rewrite by materialized view, the rewritten plan would be optimized by rules again which should add limit on SQL. This pr fix this.
…ize view (apache#40106) In BI or some other SQL client,it will set `sql_select_limit` or `default_order_by_limit` session variables automatically. This will make mistake when query rewrite by materialized view, Because after query rewrite by materialized view, the rewritten plan would be optimized by rules again which should add limit on SQL. This pr fix this.
…ize view (apache#40106) In BI or some other SQL client,it will set `sql_select_limit` or `default_order_by_limit` session variables automatically. This will make mistake when query rewrite by materialized view, Because after query rewrite by materialized view, the rewritten plan would be optimized by rules again which should add limit on SQL. This pr fix this.
Proposed changes
In BI or some other SQL client,it will set
sql_select_limit
ordefault_order_by_limit
session variables automatically.This will make mistake when query rewrite by materialized view, Because after query rewrite by materialized view, the rewritten plan would be optimized by rules again which should add limit on SQL.
This pr fix this.