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
67 lines
2.1 KiB
C++
67 lines
2.1 KiB
C++
/* Copyright (C) 2025 MariaDB Corporation
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; version 2 of
|
|
the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
MA 02110-1301, USA. */
|
|
|
|
#pragma once
|
|
|
|
#define PREFER_MY_CONFIG_H
|
|
#include <my_config.h>
|
|
#include "idb_mysql.h"
|
|
|
|
#include "execplan/calpontselectexecutionplan.h"
|
|
#include "rulebased_optimizer.h"
|
|
|
|
namespace optimizer
|
|
{
|
|
struct TableAliasLessThan
|
|
{
|
|
bool operator()(const execplan::CalpontSystemCatalog::TableAliasName& lhs,
|
|
const execplan::CalpontSystemCatalog::TableAliasName& rhs) const
|
|
{
|
|
if (lhs.schema < rhs.schema)
|
|
{
|
|
return true;
|
|
}
|
|
else if (lhs.schema == rhs.schema)
|
|
{
|
|
if (lhs.table < rhs.table)
|
|
{
|
|
return true;
|
|
}
|
|
else if (lhs.table == rhs.table)
|
|
{
|
|
if (lhs.alias < rhs.alias)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
};
|
|
|
|
using NewTableAliasAndColumnPosCounter = std::pair<std::string, size_t>;
|
|
using TableAliasMap = std::map<execplan::CalpontSystemCatalog::TableAliasName,
|
|
NewTableAliasAndColumnPosCounter, TableAliasLessThan>;
|
|
using SCAliasToPosCounterMap = std::map<std::string, size_t>;
|
|
using TableAliasToNewAliasAndSCPositionsMap =
|
|
std::map<execplan::CalpontSystemCatalog::TableAliasName,
|
|
std::tuple<std::string, SCAliasToPosCounterMap, size_t>, TableAliasLessThan>;
|
|
|
|
bool parallelCESFilter(execplan::CalpontSelectExecutionPlan& csep, optimizer::RBOptimizerContext& ctx);
|
|
bool applyParallelCES(execplan::CalpontSelectExecutionPlan& csep, optimizer::RBOptimizerContext& ctx);
|
|
} // namespace optimizer
|