提交 97c8bcce authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use proper index and remove useless search row allocation

上级 4776fd48
...@@ -312,7 +312,7 @@ public class Aggregate extends Expression { ...@@ -312,7 +312,7 @@ public class Aggregate extends Expression {
return v; return v;
} }
case MEDIAN: { case MEDIAN: {
Index index = getMinMaxColumnIndex(); Index index = getMedianColumnIndex();
long count = index.getRowCount(session); long count = index.getRowCount(session);
if (count == 0) { if (count == 0) {
return ValueNull.INSTANCE; return ValueNull.INSTANCE;
...@@ -338,7 +338,6 @@ public class Aggregate extends Expression { ...@@ -338,7 +338,6 @@ public class Aggregate extends Expression {
long skip = (count - 1) / 2; long skip = (count - 1) / 2;
for (int i = 0; i < skip; i++) { for (int i = 0; i < skip; i++) {
cursor.next(); cursor.next();
row = cursor.getSearchRow();
} }
row = cursor.getSearchRow(); row = cursor.getSearchRow();
Value v; Value v;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论