提交 52445b43 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Rename OPTIMIZABLE_MIN_MAX_COUNT_ALL to OPTIMIZABLE_AGGREGATE

上级 1b3da33b
......@@ -135,7 +135,7 @@ public class ConditionInConstantSet extends Condition {
return false;
}
switch (visitor.getType()) {
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
case ExpressionVisitor.DETERMINISTIC:
case ExpressionVisitor.READONLY:
case ExpressionVisitor.INDEPENDENT:
......
......@@ -292,7 +292,7 @@ public class ExpressionColumn extends Expression {
@Override
public boolean isEverything(ExpressionVisitor visitor) {
switch (visitor.getType()) {
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
return false;
case ExpressionVisitor.READONLY:
case ExpressionVisitor.DETERMINISTIC:
......
......@@ -33,10 +33,10 @@ public class ExpressionVisitor {
new ExpressionVisitor(INDEPENDENT);
/**
* Are all aggregates MIN(column), MAX(column), or COUNT(*) for the given
* table (getTable)?
* Are all aggregates MIN(column), MAX(column), COUNT(*), MEDIAN(column),
* ENVELOPE(count) for the given table (getTable)?
*/
public static final int OPTIMIZABLE_MIN_MAX_COUNT_ALL = 1;
public static final int OPTIMIZABLE_AGGREGATE = 1;
/**
* Does the expression return the same results for the same parameters?
......@@ -209,7 +209,7 @@ public class ExpressionVisitor {
* @return the new visitor
*/
public static ExpressionVisitor getOptimizableVisitor(Table table) {
return new ExpressionVisitor(OPTIMIZABLE_MIN_MAX_COUNT_ALL, 0, null,
return new ExpressionVisitor(OPTIMIZABLE_AGGREGATE, 0, null,
null, table, null, null, null);
}
......
......@@ -2735,7 +2735,7 @@ public class Function extends Expression implements FunctionCall {
case ExpressionVisitor.GET_DEPENDENCIES:
case ExpressionVisitor.INDEPENDENT:
case ExpressionVisitor.NOT_FROM_RESOLVER:
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID:
case ExpressionVisitor.GET_COLUMNS1:
case ExpressionVisitor.GET_COLUMNS2:
......
......@@ -156,7 +156,7 @@ public class Parameter extends Expression implements ParameterInterface {
case ExpressionVisitor.NOT_FROM_RESOLVER:
case ExpressionVisitor.QUERY_COMPARABLE:
case ExpressionVisitor.GET_DEPENDENCIES:
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
case ExpressionVisitor.DETERMINISTIC:
case ExpressionVisitor.READONLY:
case ExpressionVisitor.GET_COLUMNS1:
......
......@@ -81,7 +81,7 @@ public class Rownum extends Expression {
public boolean isEverything(ExpressionVisitor visitor) {
switch (visitor.getType()) {
case ExpressionVisitor.QUERY_COMPARABLE:
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
case ExpressionVisitor.DETERMINISTIC:
case ExpressionVisitor.INDEPENDENT:
return false;
......
......@@ -80,7 +80,7 @@ public class SequenceValue extends Expression {
public boolean isEverything(ExpressionVisitor visitor) {
switch (visitor.getType()) {
case ExpressionVisitor.EVALUATABLE:
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
case ExpressionVisitor.NOT_FROM_RESOLVER:
case ExpressionVisitor.GET_COLUMNS1:
case ExpressionVisitor.GET_COLUMNS2:
......
......@@ -150,7 +150,7 @@ public class ValueExpression extends Expression {
@Override
public boolean isEverything(ExpressionVisitor visitor) {
switch (visitor.getType()) {
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
case ExpressionVisitor.DETERMINISTIC:
case ExpressionVisitor.READONLY:
case ExpressionVisitor.INDEPENDENT:
......
......@@ -69,7 +69,7 @@ public class Variable extends Expression {
case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID:
// it is checked independently if the value is the same as the last
// time
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
case ExpressionVisitor.READONLY:
case ExpressionVisitor.INDEPENDENT:
case ExpressionVisitor.NOT_FROM_RESOLVER:
......
......@@ -781,7 +781,7 @@ public class Aggregate extends AbstractAggregate {
if (filterCondition != null && !filterCondition.isEverything(visitor)) {
return false;
}
if (visitor.getType() == ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL) {
if (visitor.getType() == ExpressionVisitor.OPTIMIZABLE_AGGREGATE) {
switch (type) {
case COUNT:
if (!distinct && on.getNullable() == Column.NOT_NULLABLE) {
......
......@@ -227,7 +227,7 @@ public abstract class DataAnalysisOperation extends Expression {
}
switch (visitor.getType()) {
case ExpressionVisitor.QUERY_COMPARABLE:
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
case ExpressionVisitor.DETERMINISTIC:
case ExpressionVisitor.INDEPENDENT:
return false;
......
......@@ -93,7 +93,7 @@ public class JavaAggregate extends AbstractAggregate {
case ExpressionVisitor.DETERMINISTIC:
// TODO optimization: some functions are deterministic, but we don't
// know (no setting for that)
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.OPTIMIZABLE_AGGREGATE:
// user defined aggregate functions can not be optimized
return false;
case ExpressionVisitor.GET_DEPENDENCIES:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论