I want to optimize a query1 of the form
SELECT yid, xid FROM x WHERE is_principal;
is_principal is a non-null boolean column of
If I run
EXPLAIN QUERY PLAN on this query, the output I get is
0|0|0|SCAN TABLE x
I'd like to turn this
SCAN into a
SEARCH, so created the following index:
CREATE INDEX x_is_principal_idx ON x (is_principal);
...but it made no difference: the output of
EXPLAIN QUERY PLAN remains unchanged.
Is there some other way to optimize this query?
1 FWIW, this query is in fact a sub-query of a much larger query that I'm trying to optimize.