public static void analyse(Database db, ClassDescriptor cld, boolean full) throws SQLException { Set tables = new HashSet(); tables.add(getTableName(cld)); tables.addAll(getIndirectionTableNames(cld));
public static void analyse(Database db, boolean full) throws SQLException {
    public static void analyse(Database db, ClassDescriptor cld, boolean full) throws SQLException {        Set tables = new HashSet();        tables.add(getTableName(cld));        tables.addAll(getIndirectionTableNames(cld));        Connection conn = db.getConnection();        boolean autoCommit = conn.getAutoCommit();        try {            conn.setAutoCommit(true);            Statement s = conn.createStatement();            Iterator tablesIter = tables.iterator();            while (tablesIter.hasNext()) {                if (full) {                    String sql = "VACUUM FULL ANALYSE " + (String) tablesIter.next();                    LOG.info(sql);                    s.execute(sql);                } else {                    String sql = "ANALYSE " + (String) tablesIter.next();                    LOG.info(sql);                    s.execute(sql);                }            }            conn.setAutoCommit(autoCommit);        } finally {            conn.setAutoCommit(autoCommit);            conn.close();        }    }