'Example query:
SELECT * FROM redis_tbl
WHERE parent = \'my-hash\' AND type = \'hash\';
Since parent is column 4 and type is colum 3, the constraints will be:
(4, apsw.SQLITE_INDEX_CONSTRAINT_EQ),
(3, apsw.SQLITE_INDEX_CONSTRAINT_EQ)
Ordering will be a list of 2-tuples consisting of the column index
and boolean for descending.
Return values are:
* Constraints used, which for each constraint, must be either None,
an integer (the argument number for the constraints passed into the
Filter() method), or (int, bool) tuple.
* Index number (default zero).
* Index string (default None).
* Boolean whether output will be in same order as the ordering specified.
* Estimated cost in disk operations.'

def BestIndex(self, constraints, orderbys):

    constraints_used = []
    columns = []
    for (i, (column_idx, comparison)) in enumerate(constraints):
        constraints_used.append(i)
        columns.append(self._columns[column_idx])
    return [constraints_used, 0, ','.join(columns), False, (1000 if ('parent' in columns) else 10000)]
