use of org.h2.result.SortOrder in project ignite by apache.
the class SqlSystemIndex method getCost.
/**
* {@inheritDoc}
*/
@Override
public double getCost(Session ses, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, HashSet<Column> allColsSet) {
double colsCost = getRowCountApproximation();
if (masks != null) {
for (Column col : columns) {
// We can effictivly use only EQUALITY condition in system views.
if ((masks[col.getColumnId()] & IndexCondition.EQUALITY) != 0)
colsCost /= 2;
}
}
double idxCost = Constants.COST_ROW_OFFSET + colsCost;
if (((SystemViewH2Adapter) table).view.isDistributed())
idxCost *= DISTRIBUTED_MUL;
return idxCost;
}
Aggregations