docs: def _get_indexes(self, schema, **kwargs):
          """return all the indexes for the given schema"""
          ret = {}
          query_str = []
          query_str.append('SELECT')
          query_str.append('  tbl.relname AS table_name, i.relname AS index_name, a.attname AS field_name,')
          query_str.append('  ix.indkey AS index_order, a.attnum AS field_num')
          query_str.append('FROM')
          query_str.append('  pg_class tbl, pg_class i, pg_index ix, pg_attribute a')
          query_str.append('WHERE')
          query_str.append('  tbl.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = tbl.oid')
          query_str.append('  AND a.attnum = ANY(ix.indkey) AND tbl.relkind = %s AND tbl.relname = %s')
          query_str.append('ORDER BY')
          query_str.append('  tbl.relname, i.relname')
          query_str = os.linesep.join(query_str)
  
          indexes = self.query(query_str, 'r', str(schema), **kwargs)
  
          # massage the data into more readable {index_name: fields} format
          for idict in indexes:
              if idict['index_name'] not in ret:
                  ret[idict['index_name']] = list(map(int, idict['index_order'].split(' ')))
  
              i = ret[idict['index_name']].index(idict['field_num'])
              ret[idict['index_name']][i] = idict['field_name']
  
          return ret