提交 77be25fc authored 作者: Thomas Mueller's avatar Thomas Mueller

Remove unused parameter

上级 701269c4
...@@ -829,7 +829,7 @@ public class Select extends Query { ...@@ -829,7 +829,7 @@ public class Select extends Query {
if (expr instanceof ExpressionColumn) { if (expr instanceof ExpressionColumn) {
Column column = ((ExpressionColumn) expr).getColumn(); Column column = ((ExpressionColumn) expr).getColumn();
int selectivity = column.getSelectivity(); int selectivity = column.getSelectivity();
Index columnIndex = topTableFilter.getTable().getIndexForColumn(column, true); Index columnIndex = topTableFilter.getTable().getIndexForColumn(column);
if (columnIndex != null && selectivity != Constants.SELECTIVITY_DEFAULT && selectivity < 20) { if (columnIndex != null && selectivity != Constants.SELECTIVITY_DEFAULT && selectivity < 20) {
// the first column must be ascending // the first column must be ascending
boolean ascending = columnIndex.getIndexColumns()[0].sortType == SortOrder.ASCENDING; boolean ascending = columnIndex.getIndexColumns()[0].sortType == SortOrder.ASCENDING;
......
...@@ -271,7 +271,7 @@ public class Aggregate extends Expression { ...@@ -271,7 +271,7 @@ public class Aggregate extends Expression {
case MIN: case MIN:
case MAX: case MAX:
boolean first = type == MIN; boolean first = type == MIN;
Index index = getColumnIndex(first); Index index = getColumnIndex();
int sortType = index.getIndexColumns()[0].sortType; int sortType = index.getIndexColumns()[0].sortType;
if ((sortType & SortOrder.DESCENDING) != 0) { if ((sortType & SortOrder.DESCENDING) != 0) {
first = !first; first = !first;
...@@ -537,14 +537,14 @@ public class Aggregate extends Expression { ...@@ -537,14 +537,14 @@ public class Aggregate extends Expression {
return text + StringUtils.enclose(on.getSQL()); return text + StringUtils.enclose(on.getSQL());
} }
private Index getColumnIndex(boolean first) { private Index getColumnIndex() {
if (on instanceof ExpressionColumn) { if (on instanceof ExpressionColumn) {
ExpressionColumn col = (ExpressionColumn) on; ExpressionColumn col = (ExpressionColumn) on;
Column column = col.getColumn(); Column column = col.getColumn();
TableFilter filter = col.getTableFilter(); TableFilter filter = col.getTableFilter();
if (filter != null) { if (filter != null) {
Table table = filter.getTable(); Table table = filter.getTable();
Index index = table.getIndexForColumn(column, first); Index index = table.getIndexForColumn(column);
return index; return index;
} }
} }
...@@ -563,8 +563,7 @@ public class Aggregate extends Expression { ...@@ -563,8 +563,7 @@ public class Aggregate extends Expression {
return visitor.getTable().canGetRowCount(); return visitor.getTable().canGetRowCount();
case MIN: case MIN:
case MAX: case MAX:
boolean first = type == MIN; Index index = getColumnIndex();
Index index = getColumnIndex(first);
return index != null; return index != null;
default: default:
return false; return false;
......
...@@ -942,10 +942,9 @@ public abstract class Table extends SchemaObjectBase { ...@@ -942,10 +942,9 @@ public abstract class Table extends SchemaObjectBase {
* This method returns null if no matching index is found. * This method returns null if no matching index is found.
* *
* @param column the column * @param column the column
* @param first if the min value should be returned
* @return the index or null * @return the index or null
*/ */
public Index getIndexForColumn(Column column, boolean first) { public Index getIndexForColumn(Column column) {
ArrayList<Index> indexes = getIndexes(); ArrayList<Index> indexes = getIndexes();
if (indexes != null) { if (indexes != null) {
for (int i = 1, size = indexes.size(); i < size; i++) { for (int i = 1, size = indexes.size(); i < size; i++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论