use of com.wplatform.ddal.dbobject.table.PlanItem in project jdbc-shards by wplatform.
the class Update method prepare.
@Override
public void prepare() {
if (condition != null) {
condition.mapColumns(tableFilter, 0);
condition = condition.optimize(session);
condition.createIndexConditions(session, tableFilter);
}
for (int i = 0, size = columns.size(); i < size; i++) {
Column c = columns.get(i);
Expression e = expressionMap.get(c);
e.mapColumns(tableFilter, 0);
expressionMap.put(c, e.optimize(session));
}
PlanItem item = tableFilter.getBestPlanItem(session, 1);
tableFilter.setPlanItem(item);
tableFilter.prepare();
}
use of com.wplatform.ddal.dbobject.table.PlanItem in project jdbc-shards by wplatform.
the class Delete method prepare.
@Override
public void prepare() {
if (condition != null) {
condition.mapColumns(tableFilter, 0);
condition = condition.optimize(session);
condition.createIndexConditions(session, tableFilter);
}
PlanItem item = tableFilter.getBestPlanItem(session, 1);
tableFilter.setPlanItem(item);
tableFilter.prepare();
}
use of com.wplatform.ddal.dbobject.table.PlanItem in project jdbc-shards by wplatform.
the class Optimizer method optimize.
/**
* Calculate the best query plan to use.
*/
void optimize() {
calculateBestPlan();
bestPlan.removeUnusableIndexConditions();
TableFilter[] f2 = bestPlan.getFilters();
topFilter = f2[0];
for (int i = 0; i < f2.length - 1; i++) {
f2[i].addJoin(f2[i + 1], false, false, null);
}
for (TableFilter f : f2) {
PlanItem item = bestPlan.getItem(f);
f.setPlanItem(item);
}
}
Aggregations