You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-3839 Fix for different window frames. Optimize count(*) with window function
This commit is contained in:
@ -125,24 +125,22 @@ void WF_count<T>::operator()(int64_t b, int64_t e, int64_t c)
|
|||||||
if (!isNull)
|
if (!isNull)
|
||||||
{
|
{
|
||||||
// constant, set fCount to row count
|
// constant, set fCount to row count
|
||||||
fCount = e - b + 1;
|
fCount += e - b + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (fFunctionId == WF__COUNT_ASTERISK)
|
||||||
|
{
|
||||||
|
// count(*), set fCount to row count
|
||||||
|
fCount += e - b + 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int64_t i = b; i <= e; i++)
|
for (int64_t i = b; i <= e; i++)
|
||||||
{
|
{
|
||||||
if (i % 1000 == 0 && fStep->cancelled())
|
if (i % 1000 == 0 && fStep->cancelled())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (fFunctionId == WF__COUNT_ASTERISK)
|
|
||||||
{
|
|
||||||
fCount++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
fRow.setData(getPointer(fRowData->at(i)));
|
fRow.setData(getPointer(fRowData->at(i)));
|
||||||
|
|
||||||
if (fRow.isNullValue(colIn) == true)
|
if (fRow.isNullValue(colIn) == true)
|
||||||
|
Reference in New Issue
Block a user