1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-30 07:25:34 +03:00

fix(rbo,rules,QA): ExistsFilter::transform merges statistics to enable QA for EXISTS expressions.

This commit is contained in:
drrtuy
2025-09-01 15:13:17 +00:00
committed by Leonid Fedorov
parent b92e5ae155
commit 96fc875255
3 changed files with 13 additions and 3 deletions

View File

@@ -1182,10 +1182,15 @@ execplan::SCSEP CalpontSelectExecutionPlan::cloneForTableWORecursiveSelectsGbObH
// Deep copy of column map // Deep copy of column map
for (const auto& entry : fColumnMap) for (const auto& entry : fColumnMap)
{ {
// WIP only relevant RCs must be copied auto tableAlias = entry.second->singleTable();
if (entry.second) // TODO We insert multiple times if there are multiple SCs for the same RC.
if (tableAlias && targetTableAlias.weakerEq(*tableAlias))
{ {
newColumnMap.insert({entry.first, SRCP(entry.second->clone())}); auto it = fColumnMap.find(entry.first);
if (it == fColumnMap.end())
{
newColumnMap.insert({entry.first, SRCP(entry.second->clone())});
}
} }
} }

View File

@@ -127,6 +127,9 @@ execplan::ParseTree* ExistsSub::transform()
return NULL; return NULL;
} }
// Insert column statistics
fGwip.mergeTableStatistics(gwi.tableStatisticsMap);
// remove outer query tables // remove outer query tables
CalpontSelectExecutionPlan::TableList tblist; CalpontSelectExecutionPlan::TableList tblist;

View File

@@ -441,6 +441,8 @@ execplan::SCSEP createDerivedTableFromTable(execplan::CalpontSelectExecutionPlan
} }
{ {
derivedCSEP->tableAlias(tableAlias, true);
auto additionalUnionVec = makeUnionFromTable( auto additionalUnionVec = makeUnionFromTable(
*derivedCSEP, const_cast<execplan::CalpontSystemCatalog::TableAliasName&>(table), ctx); *derivedCSEP, const_cast<execplan::CalpontSystemCatalog::TableAliasName&>(table), ctx);