SQLite Forum

What indexes help Window Functions
All the columns in the partition by clause, in order, followed by all the columns in the order by clause, in order.  If you wish the index to be covering then you need to append any columns used in filter expressions, followed by any columns actually used in calculations or in the output projection.