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

Remove unused parameter

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