Set precomps = PrecomputedTableManager.getInstance(getDatabase()).getPrecomputedTables(); QueryOptimiser.recursiveOptimise(precomps, q, bestQuery, q);
Set precompsSet = PrecomputedTableManager.getInstance(getDatabase()).getPrecomputedTables(); QueryOptimiser.recursiveOptimise(precompsSet, q, bestQuery, q);
    public void executeTest(String type) throws Exception {        String queryString = (String) queries.get(type);        Query q = new Query(queryString);        BestQueryStorer bestQuery = new BestQueryStorer();        Set precomps = PrecomputedTableManager.getInstance(getDatabase()).getPrecomputedTables();        QueryOptimiser.recursiveOptimise(precomps, q, bestQuery, q);        Set optimisedQueries = bestQuery.getQueries();        // optimisedQueries now contains the set of queries we need to see all give the same results        Iterator queriesIter = optimisedQueries.iterator();        while (queriesIter.hasNext()) {            Query optimisedQuery = (Query) queriesIter.next();            checkResultsForQueries(q, optimisedQuery);        }        System.out.println(type + "(" + optimisedQueries.size() + " choices)");        // Now try the optimise() method. We don't know which of the        // set of queries we are actually going to get back, but we        // can check that it takes less time than the original query.        String optimisedQuery = QueryOptimiser.optimise(queryString, getDatabase());        if (queryString.equals(optimisedQuery)) {            System.out.println(": ORIGINAL ");        } else {            System.out.println(": OPTIMISED ");        }        checkResultsForQueries(q, new Query(optimisedQuery));    }