Skip to content

Commit

Permalink
Merge 4652438 into 742f46d
Browse files Browse the repository at this point in the history
  • Loading branch information
Dark-Avery authored Jan 30, 2024
2 parents 742f46d + 4652438 commit 6cc7b36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions ydb/library/yql/dq/opt/dq_opt_join_cost_based.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ template <int N> std::bitset<N> TDPccpSolver<N>::NextBitset(const std::bitset<N>
return res;

// TODO: We can optimize this with a few long integer operations,
// but it will only work for 64 bit bitsets
// but it will only work for 128 bit bitsets
// return std::bitset<N>((prev | ~final).to_ulong() + 1) & final;
}

Expand Down Expand Up @@ -1014,7 +1014,7 @@ std::shared_ptr<TJoinOptimizerNode> OptimizeSubtree(const std::shared_ptr<TJoinO
return PickBestNonReorderabeJoin(joinTree->LeftArg, joinTree->RightArg, joinTree->JoinConditions, joinTree->JoinType, ctx);
}

TGraph<64> joinGraph;
TGraph<128> joinGraph;
TVector<std::shared_ptr<IBaseOptimizerNode>> rels;
std::set<std::pair<TJoinColumn, TJoinColumn>> joinConditions;

Expand All @@ -1024,10 +1024,10 @@ std::shared_ptr<TJoinOptimizerNode> OptimizeSubtree(const std::shared_ptr<TJoinO
joinGraph.AddNode(i, rels[i]->Labels());
}

// Check if we have more rels than DPccp can handle (64)
// Check if we have more rels than DPccp can handle (128)
// If that's the case - don't optimize the plan and just return it with
// computed statistics
if (rels.size() >= 64) {
if (rels.size() >= 128) {
ComputeStatistics(joinTree, ctx);
return joinTree;
}
Expand Down Expand Up @@ -1055,7 +1055,7 @@ std::shared_ptr<TJoinOptimizerNode> OptimizeSubtree(const std::shared_ptr<TJoinO
YQL_CLOG(TRACE, CoreDq) << str.str();
}

TDPccpSolver<64> solver(joinGraph, rels, ctx);
TDPccpSolver<128> solver(joinGraph, rels, ctx);

// Check that the dynamic table of DPccp is not too big
// If it is, just compute the statistics for the join tree and return it
Expand Down Expand Up @@ -1172,7 +1172,7 @@ class TOptimizerNative: public IOptimizer {

TOutput JoinSearch() override {
auto dummyProviderCtx = TDummyProviderContext();
TDPccpSolver<64> solver(JoinGraph, Rels, dummyProviderCtx);
TDPccpSolver<128> solver(JoinGraph, Rels, dummyProviderCtx);
std::shared_ptr<TJoinOptimizerNode> result = solver.Solve();
if (Log) {
std::stringstream str;
Expand Down Expand Up @@ -1282,7 +1282,7 @@ class TOptimizerNative: public IOptimizer {
const std::function<void(const TString&)> Log;

TVector<std::shared_ptr<IBaseOptimizerNode>> Rels;
TGraph<64> JoinGraph;
TGraph<128> JoinGraph;
};

IOptimizer* MakeNativeOptimizer(const IOptimizer::TInput& input, const std::function<void(const TString&)>& log) {
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/yql/providers/dq/common/yql_dq_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct TDqSettings {
static constexpr ETaskRunnerStats TaskRunnerStats = ETaskRunnerStats::Basic;
static constexpr ESpillingEngine SpillingEngine = ESpillingEngine::Disable;
static constexpr ui32 CostBasedOptimizationLevel = 0;
static constexpr ui32 MaxDPccpDPTableSize = 10000U;
static constexpr ui32 MaxDPccpDPTableSize = 16400U;

};

Expand Down

0 comments on commit 6cc7b36

Please sign in to comment.