}
QueryTree optimizedQT = qt;
QueryTransformer queryTransformer = new BasicQueryRewriter(rules);
IndexesGenerator indexesGenerator = new IndexesGenerator();
try {
optimizedQT = queryTransformer.transform(optimizedQT);
if (debug) {
logger.log(BasicLevel.DEBUG, "Query optimized");
QueryTreePrinter.printQueryTree(optimizedQT, logger);
}
optimizedQT = indexesGenerator.transform(optimizedQT);