diff options
author | aozeritsky <aozeritsky@ydb.tech> | 2023-08-28 15:28:12 +0300 |
---|---|---|
committer | aozeritsky <aozeritsky@ydb.tech> | 2023-08-28 16:15:25 +0300 |
commit | 57ebaff92803261073720a0db22d8f1b99a582f4 (patch) | |
tree | 02288e69af9fe8f2249dac7d7091eb98a4d4e030 | |
parent | 190eefa755c40a2db39b411ce1a02ba819068d2d (diff) | |
download | ydb-57ebaff92803261073720a0db22d8f1b99a582f4.tar.gz |
Add cbo optimizer
-rw-r--r-- | ydb/library/yql/providers/dq/opt/logical_optimize.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ydb/library/yql/providers/dq/opt/logical_optimize.cpp b/ydb/library/yql/providers/dq/opt/logical_optimize.cpp index c1b827f88b..8187676776 100644 --- a/ydb/library/yql/providers/dq/opt/logical_optimize.cpp +++ b/ydb/library/yql/providers/dq/opt/logical_optimize.cpp @@ -55,6 +55,7 @@ public: AddHandler(0, &TCoUnorderedBase::Match, HNDL(SkipUnordered)); AddHandler(0, &TCoAggregateBase::Match, HNDL(RewriteAggregate)); AddHandler(0, &TCoTake::Match, HNDL(RewriteTakeSortToTopSort)); + AddHandler(0, &TCoEquiJoin::Match, HNDL(OptimizeEquiJoinWithCosts)); AddHandler(0, &TCoEquiJoin::Match, HNDL(RewriteEquiJoin)); AddHandler(0, &TCoCalcOverWindowBase::Match, HNDL(ExpandWindowFunctions)); AddHandler(0, &TCoCalcOverWindowGroup::Match, HNDL(ExpandWindowFunctions)); @@ -112,6 +113,14 @@ protected: return node; } + TMaybeNode<TExprBase> OptimizeEquiJoinWithCosts(TExprBase node, TExprContext& ctx) { + if (TypesCtx.CostBasedOptimizerType == "native") { + return DqOptimizeEquiJoinWithCosts(node, ctx, TypesCtx, true); + } else { + return node; + } + } + TMaybeNode<TExprBase> RewriteEquiJoin(TExprBase node, TExprContext& ctx) { auto equiJoin = node.Cast<TCoEquiJoin>(); bool hasDqConnections = false; |