You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-10-31 18:30:33 +03:00
chore(format): apply clang-format
This commit is contained in:
@@ -978,8 +978,8 @@ extern "C"
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (l > TraceSize)
|
||||
l = TraceSize;
|
||||
if (l > TraceSize * 100)
|
||||
l = TraceSize * 100;
|
||||
|
||||
*length = l;
|
||||
return out->c_str();
|
||||
|
||||
@@ -129,7 +129,6 @@ static void store_query_plan(execplan::SCSEP& csep, PlanType planType)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void store_applied_rules(const std::string rboRules)
|
||||
{
|
||||
cal_connection_info* ci = ensure_conn_info();
|
||||
|
||||
@@ -79,8 +79,8 @@ bool someForeignTablesHasStatisticsAndMbIndex(execplan::CalpontSelectExecutionPl
|
||||
[&ctx](const auto& table)
|
||||
{
|
||||
cal_impl_if::SchemaAndTableName schemaAndTableName = {table.schema, table.table};
|
||||
return (!table.isColumnstore() &&
|
||||
ctx.getGwi().tableStatisticsMap.find(schemaAndTableName) != ctx.getGwi().tableStatisticsMap.end());
|
||||
return (!table.isColumnstore() && ctx.getGwi().tableStatisticsMap.find(schemaAndTableName) !=
|
||||
ctx.getGwi().tableStatisticsMap.end());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ namespace optimizer
|
||||
|
||||
using DerivedToFiltersMap = std::map<std::string, execplan::ParseTree*>;
|
||||
|
||||
bool predicatePushdownFilter(execplan::CalpontSelectExecutionPlan& csep, optimizer::RBOptimizerContext& /*ctx*/)
|
||||
bool predicatePushdownFilter(execplan::CalpontSelectExecutionPlan& csep,
|
||||
optimizer::RBOptimizerContext& /*ctx*/)
|
||||
{
|
||||
// The original rule match contains questionable decision to filter out
|
||||
// queries that contains any UNION UNIT with only derived tables.
|
||||
@@ -40,7 +41,6 @@ bool predicatePushdownFilter(execplan::CalpontSelectExecutionPlan& csep, optimiz
|
||||
return !csep.tableList().empty();
|
||||
}
|
||||
|
||||
|
||||
void setDerivedTable(execplan::ParseTree* n)
|
||||
{
|
||||
execplan::ParseTree* lhs = n->left();
|
||||
@@ -75,7 +75,8 @@ void setDerivedTable(execplan::ParseTree* n)
|
||||
}
|
||||
}
|
||||
|
||||
execplan::ParseTree* setDerivedFilter(cal_impl_if::gp_walk_info* gwip, execplan::ParseTree*& n, DerivedToFiltersMap& filterMap,
|
||||
execplan::ParseTree* setDerivedFilter(cal_impl_if::gp_walk_info* gwip, execplan::ParseTree*& n,
|
||||
DerivedToFiltersMap& filterMap,
|
||||
const execplan::CalpontSelectExecutionPlan::SelectList& derivedTbList)
|
||||
{
|
||||
if (!(n->derivedTable().empty()))
|
||||
@@ -86,7 +87,8 @@ execplan::ParseTree* setDerivedFilter(cal_impl_if::gp_walk_info* gwip, execplan:
|
||||
|
||||
for (uint i = 0; i < derivedTbList.size(); i++)
|
||||
{
|
||||
execplan::CalpontSelectExecutionPlan* plan = dynamic_cast<execplan::CalpontSelectExecutionPlan*>(derivedTbList[i].get());
|
||||
execplan::CalpontSelectExecutionPlan* plan =
|
||||
dynamic_cast<execplan::CalpontSelectExecutionPlan*>(derivedTbList[i].get());
|
||||
|
||||
if (plan->derivedTbAlias() == n->derivedTable())
|
||||
{
|
||||
@@ -176,7 +178,8 @@ bool applyPredicatePushdown(execplan::CalpontSelectExecutionPlan& csep, RBOptimi
|
||||
// @todo outer join complication
|
||||
for (uint i = 0; i < derivedTbList.size(); i++)
|
||||
{
|
||||
execplan::CalpontSelectExecutionPlan* plan = dynamic_cast<execplan::CalpontSelectExecutionPlan*>(derivedTbList[i].get());
|
||||
execplan::CalpontSelectExecutionPlan* plan =
|
||||
dynamic_cast<execplan::CalpontSelectExecutionPlan*>(derivedTbList[i].get());
|
||||
execplan::CalpontSelectExecutionPlan::ReturnedColumnList derivedColList = plan->returnedCols();
|
||||
auto mapIt = derivedTbFilterMap.find(plan->derivedTbAlias());
|
||||
|
||||
|
||||
@@ -35,29 +35,61 @@ class RBOptimizerContext
|
||||
{
|
||||
public:
|
||||
RBOptimizerContext() = delete;
|
||||
RBOptimizerContext(cal_impl_if::gp_walk_info& walk_info, THD& thd, bool logRules, uint cesOptimizationParallelFactor = 50)
|
||||
: gwi_(walk_info), thd_(thd), logRules_(logRules), cesOptimizationParallelFactor_(cesOptimizationParallelFactor)
|
||||
RBOptimizerContext(cal_impl_if::gp_walk_info& walk_info, THD& thd, bool logRules,
|
||||
uint cesOptimizationParallelFactor = 50)
|
||||
: gwi_(walk_info)
|
||||
, thd_(thd)
|
||||
, logRules_(logRules)
|
||||
, cesOptimizationParallelFactor_(cesOptimizationParallelFactor)
|
||||
{
|
||||
}
|
||||
|
||||
// Accessors
|
||||
cal_impl_if::gp_walk_info& getGwi() { return gwi_; }
|
||||
THD& getThd() { return thd_; }
|
||||
uint64_t getUniqueId() const { return uniqueId_; }
|
||||
void incrementUniqueId() { ++uniqueId_; }
|
||||
bool logRulesEnabled() const { return logRules_; }
|
||||
uint getCesOptimizationParallelFactor() const { return cesOptimizationParallelFactor_; }
|
||||
cal_impl_if::gp_walk_info& getGwi()
|
||||
{
|
||||
return gwi_;
|
||||
}
|
||||
THD& getThd()
|
||||
{
|
||||
return thd_;
|
||||
}
|
||||
uint64_t getUniqueId() const
|
||||
{
|
||||
return uniqueId_;
|
||||
}
|
||||
void incrementUniqueId()
|
||||
{
|
||||
++uniqueId_;
|
||||
}
|
||||
bool logRulesEnabled() const
|
||||
{
|
||||
return logRules_;
|
||||
}
|
||||
uint getCesOptimizationParallelFactor() const
|
||||
{
|
||||
return cesOptimizationParallelFactor_;
|
||||
}
|
||||
|
||||
// Applied rules API
|
||||
void addAppliedRule(const std::string& name) { appliedRules_.push_back(name); }
|
||||
const std::vector<std::string>& getAppliedRules() const { return appliedRules_; }
|
||||
bool hasAppliedRules() const { return !appliedRules_.empty(); }
|
||||
void addAppliedRule(const std::string& name)
|
||||
{
|
||||
appliedRules_.push_back(name);
|
||||
}
|
||||
const std::vector<std::string>& getAppliedRules() const
|
||||
{
|
||||
return appliedRules_;
|
||||
}
|
||||
bool hasAppliedRules() const
|
||||
{
|
||||
return !appliedRules_.empty();
|
||||
}
|
||||
std::string serializeAppliedRules() const
|
||||
{
|
||||
std::string out;
|
||||
for (size_t i = 0; i < appliedRules_.size(); ++i)
|
||||
{
|
||||
if (i) out += ",";
|
||||
if (i)
|
||||
out += ",";
|
||||
out += appliedRules_[i];
|
||||
}
|
||||
return out;
|
||||
|
||||
Reference in New Issue
Block a user