You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-08 14:22:09 +03:00
MCOL-1052 CS group_by_handler now uses CS internal sorting.
This commit is contained in:
@@ -751,8 +751,8 @@ int doFromSubquery(CalpontExecutionPlan* ep, const string& alias, const string&
|
|||||||
void addOrderByAndLimit(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo)
|
void addOrderByAndLimit(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo)
|
||||||
{
|
{
|
||||||
// make sure there is a LIMIT
|
// make sure there is a LIMIT
|
||||||
if (csep->orderByCols().size() > 0 && csep->limitNum() == (uint64_t) - 1)
|
// if (csep->orderByCols().size() > 0 csep->limitNum() == (uint64_t) - 1)
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
jobInfo.limitStart = csep->limitStart();
|
jobInfo.limitStart = csep->limitStart();
|
||||||
jobInfo.limitCount = csep->limitNum();
|
jobInfo.limitCount = csep->limitNum();
|
||||||
|
@@ -483,28 +483,28 @@ void adjustLastStep(JobStepVector& querySteps, DeliveredTableMap& deliverySteps,
|
|||||||
deliverySteps[CNX_VTABLE_ID] = ws;
|
deliverySteps[CNX_VTABLE_ID] = ws;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((jobInfo.limitCount != (uint64_t) - 1) ||
|
// if ((jobInfo.limitCount != (uint64_t) - 1) ||
|
||||||
(jobInfo.constantCol == CONST_COL_EXIST) ||
|
// (jobInfo.constantCol == CONST_COL_EXIST) ||
|
||||||
(jobInfo.hasDistinct))
|
// (jobInfo.hasDistinct))
|
||||||
{
|
// {
|
||||||
if (jobInfo.annexStep.get() == NULL)
|
if (jobInfo.annexStep.get() == NULL)
|
||||||
jobInfo.annexStep.reset(new TupleAnnexStep(jobInfo));
|
jobInfo.annexStep.reset(new TupleAnnexStep(jobInfo));
|
||||||
|
|
||||||
TupleAnnexStep* tas = dynamic_cast<TupleAnnexStep*>(jobInfo.annexStep.get());
|
TupleAnnexStep* tas = dynamic_cast<TupleAnnexStep*>(jobInfo.annexStep.get());
|
||||||
tas->setLimit(jobInfo.limitStart, jobInfo.limitCount);
|
tas->setLimit(jobInfo.limitStart, jobInfo.limitCount);
|
||||||
|
|
||||||
if (jobInfo.limitCount != (uint64_t) - 1)
|
// if (jobInfo.limitCount != (uint64_t) - 1)
|
||||||
{
|
// {
|
||||||
if (jobInfo.orderByColVec.size() > 0)
|
if (jobInfo.orderByColVec.size() > 0)
|
||||||
tas->addOrderBy(new LimitedOrderBy());
|
tas->addOrderBy(new LimitedOrderBy());
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (jobInfo.constantCol == CONST_COL_EXIST)
|
if (jobInfo.constantCol == CONST_COL_EXIST)
|
||||||
tas->addConstant(new TupleConstantStep(jobInfo));
|
tas->addConstant(new TupleConstantStep(jobInfo));
|
||||||
|
|
||||||
if (jobInfo.hasDistinct)
|
if (jobInfo.hasDistinct)
|
||||||
tas->setDistinct();
|
tas->setDistinct();
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (jobInfo.annexStep)
|
if (jobInfo.annexStep)
|
||||||
{
|
{
|
||||||
|
@@ -1622,7 +1622,7 @@ void makeVtableModeSteps(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo,
|
|||||||
JobStepVector& querySteps, JobStepVector& projectSteps, DeliveredTableMap& deliverySteps)
|
JobStepVector& querySteps, JobStepVector& projectSteps, DeliveredTableMap& deliverySteps)
|
||||||
{
|
{
|
||||||
// @bug4848, enhance and unify limit handling.
|
// @bug4848, enhance and unify limit handling.
|
||||||
if (csep->limitNum() != (uint64_t) - 1)
|
// if (csep->limitNum() != (uint64_t) - 1)
|
||||||
{
|
{
|
||||||
// special case for outer query order by limit -- return all
|
// special case for outer query order by limit -- return all
|
||||||
if (jobInfo.subId == 0 && csep->hasOrderBy())
|
if (jobInfo.subId == 0 && csep->hasOrderBy())
|
||||||
|
@@ -76,7 +76,13 @@ void LimitedOrderBy::initialize(const RowGroup& rg, const JobInfo& jobInfo)
|
|||||||
{
|
{
|
||||||
map<uint32_t, uint32_t>::iterator j = keyToIndexMap.find(i->first);
|
map<uint32_t, uint32_t>::iterator j = keyToIndexMap.find(i->first);
|
||||||
idbassert(j != keyToIndexMap.end());
|
idbassert(j != keyToIndexMap.end());
|
||||||
fOrderByCond.push_back(IdbSortSpec(j->second, i->second));
|
// MCOL-1052 Ordering direction in CSEP differs from
|
||||||
|
// internal direction representation.
|
||||||
|
if (i->second)
|
||||||
|
fOrderByCond.push_back(IdbSortSpec(j->second, false));
|
||||||
|
else
|
||||||
|
fOrderByCond.push_back(IdbSortSpec(j->second, true));
|
||||||
|
//fOrderByCond.push_back(IdbSortSpec(j->second, i->second));
|
||||||
}
|
}
|
||||||
|
|
||||||
// limit row count info
|
// limit row count info
|
||||||
@@ -174,7 +180,9 @@ void LimitedOrderBy::finalize()
|
|||||||
if (fRowGroup.getRowCount() > 0)
|
if (fRowGroup.getRowCount() > 0)
|
||||||
fDataQueue.push(fData);
|
fDataQueue.push(fData);
|
||||||
|
|
||||||
if (fStart != 0)
|
// MCOL-1052 The removed check effectivly disables sorting to happen,
|
||||||
|
// since fStart = 0;
|
||||||
|
if (true)
|
||||||
{
|
{
|
||||||
uint64_t newSize = fRowsPerRG * fRowGroup.getRowSize();
|
uint64_t newSize = fRowsPerRG * fRowGroup.getRowSize();
|
||||||
fMemSize += newSize;
|
fMemSize += newSize;
|
||||||
|
@@ -20,9 +20,6 @@ SET ( libcalmysql_SRCS
|
|||||||
ha_pseudocolumn.cpp)
|
ha_pseudocolumn.cpp)
|
||||||
|
|
||||||
add_definitions(-DMYSQL_DYNAMIC_PLUGIN)
|
add_definitions(-DMYSQL_DYNAMIC_PLUGIN)
|
||||||
add_definitions(-DDEBUG_WALK_COND=1)
|
|
||||||
add_definitions(-DINFINIDB_DEBUG=1)
|
|
||||||
#add_definitions(-DOUTER_JOIN_DEBUG)
|
|
||||||
|
|
||||||
set_source_files_properties(ha_calpont.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti -fno-implicit-templates")
|
set_source_files_properties(ha_calpont.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti -fno-implicit-templates")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user