code: public List<String> listIndexDefinitions(boolean used, List<String> tables)
    {
      String scansOp = used ? "!=" : "=";
      String sql
        = "SELECT pg_get_indexdef(x.indexrelid) AS indexdef "
        + "FROM pg_index x, pg_class c "
        + "WHERE x.indexrelid = c.oid "
        + "AND c.relname IN ( " + StringUtils.repeat("?", ",", tables.size())
        + ") "
        + "AND pg_stat_get_numscans(x.indexrelid) " + scansOp + " 0";
      return getJdbcTemplate().query(sql, tables.toArray(), stringRowMapper());
    }
docs: /*
  Returns the CREATE INDEX statement for all indexes on the Annis tables,
  that are not auto-created by PostgreSQL (primary keys and unique
  constraints).
  
  @param used	If True, return used indexes. If False, return unused indexes
  (scan count is 0).