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