>> CREATE INDEX some_index_name ON slot_purchases(position_price,ts) WHERE
>> status IS NULL;
>
> Error: near "where": syntax error
> sqlite>
>
> Which what database did you do that?
Postgresql. MS SQL Server 2008 apparently supports something similar too.
if you haven't got partial indexes to play with could try.
CREATE INDEX some_index_name_a ON slot_purchases(status,position_price,ts);
or possibly
CREATE INDEX some_index_name_b ON slot_purchases(status IS NULL,position_price,ts);
if you're only expecting a few results omitting the ts column from the
index may give better performance
if a significant proportion have status IS NULL the index may not
actually pay for its upkeep.
--
⚂⚃ 100% natural