public QueryPlan optimize(SelectStatement select, PhoenixStatement statement) throws SQLException {
return optimize(select, statement, Collections.<PColumn>emptyList(), null);
}
public QueryPlan optimize(SelectStatement select, PhoenixStatement statement, List<? extends PDatum> targetColumns, ParallelIteratorFactory parallelIteratorFactory) throws SQLException {
QueryCompiler compiler = new QueryCompiler(statement, targetColumns, parallelIteratorFactory);
QueryPlan dataPlan = compiler.compile(select);
if (!useIndexes || select.getFrom().size() > 1) {
return dataPlan;
}
// Get the statement as it's been normalized now
// TODO: the recompile for the index tables could skip the normalize step