1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-31 18:30:33 +03:00

chore(rbo,rules): removed extra printouts.

This commit is contained in:
drrtuy
2025-08-13 12:29:46 +00:00
committed by Leonid Fedorov
parent 80f81526eb
commit 08d89fcef7
2 changed files with 38 additions and 49 deletions

View File

@@ -7610,14 +7610,6 @@ int cs_get_select_plan(ha_columnstore_select_handler* handler, THD* thd, SCSEP&
}
}
derivedTableOptimization(&gwi, csep);
if (csep->traceOn())
{
cerr << "---------------- cs_get_select_plan 2nd derived table optimization pass EXECUTION PLAN ----------------" << endl;
cerr << *csep << endl;
cerr << "-------------- EXECUTION PLAN END --------------\n" << endl;
}
return 0;
}

View File

@@ -208,9 +208,6 @@ template <typename T>
std::optional<FilterRangeBounds<T>> populateRangeBounds(Histogram_json_hb* columnStatistics)
{
FilterRangeBounds<T> bounds;
// bounds.push_back({0, 6200000});
// return bounds;
// TODO configurable parallel factor via session variable
// NB now histogram size is the way to control parallel factor with 16 being the maximum
@@ -257,33 +254,33 @@ execplan::CalpontSelectExecutionPlan::SelectList makeUnionFromTable(
execplan::CalpontSelectExecutionPlan& csep, execplan::CalpontSystemCatalog::TableAliasName& table,
optimizer::RBOptimizerContext& ctx)
{
execplan::CalpontSelectExecutionPlan::SelectList unionVec;
execplan::CalpontSelectExecutionPlan::SelectList unionVec;
// SC type controls an integral type used to produce suitable filters. The continuation of this function
// should become a template function based on SC type.
auto keyColumnAndStatistics = chooseKeyColumnAndStatistics(table, ctx);
if (!keyColumnAndStatistics)
{
// SC type controls an integral type used to produce suitable filters. The continuation of this function
// should become a template function based on SC type.
auto keyColumnAndStatistics = chooseKeyColumnAndStatistics(table, ctx);
if (!keyColumnAndStatistics)
{
return unionVec;
}
}
auto& [keyColumn, columnStatistics] = keyColumnAndStatistics.value();
auto& [keyColumn, columnStatistics] = keyColumnAndStatistics.value();
std::cout << "makeUnionFromTable keyColumn " << keyColumn.toString() << std::endl;
std::cout << "makeUnionFromTable RC front " << csep.returnedCols().front()->toString() << std::endl;
std::cout << "makeUnionFromTable keyColumn " << keyColumn.toString() << std::endl;
std::cout << "makeUnionFromTable RC front " << csep.returnedCols().front()->toString() << std::endl;
// TODO char and other numerical types support
auto boundsOpt = populateRangeBounds<uint64_t>(columnStatistics);
if (!boundsOpt.has_value())
{
// TODO char and other numerical types support
auto boundsOpt = populateRangeBounds<uint64_t>(columnStatistics);
if (!boundsOpt.has_value())
{
return unionVec;
}
}
auto& bounds = boundsOpt.value();
auto& bounds = boundsOpt.value();
// These bounds produce low <= col < high
if (bounds.size() > 1)
{
// These bounds produce low <= col < high
if (bounds.size() > 1)
{
for (size_t i = 0; i <= bounds.size() - 2; ++i)
{
auto clonedCSEP = csep.cloneForTableWORecursiveSelectsGbObHaving(table);
@@ -294,19 +291,19 @@ if (bounds.size() > 1)
clonedCSEP->columnMap().insert({keyColumn.columnName(), execplan::SRCP(keyColumn.clone())});
unionVec.push_back(clonedCSEP);
}
}
// This last bound produces low <= col <= high
// TODO add NULLs into filter of the last step
if (!bounds.empty())
{
}
// This last bound produces low <= col <= high
// TODO add NULLs into filter of the last step
if (!bounds.empty())
{
auto clonedCSEP = csep.cloneForTableWORecursiveSelectsGbObHaving(table);
auto filter = filtersWithNewRange(clonedCSEP, keyColumn, bounds.back(), true);
clonedCSEP->columnMap().insert({keyColumn.columnName(), execplan::SRCP(keyColumn.clone())});
clonedCSEP->filters(filter);
unionVec.push_back(clonedCSEP);
}
}
return unionVec;
return unionVec;
}
execplan::SCSEP createDerivedTableFromTable(