SQLite Forum

index to help with selection and ordering
Login
I'm sure this must be faq and perhaps obvious but I appear to not see it.

It seems difficult to create an index which helps with both selection and ordering.  For example, imagine a table with a timestamp column and a name column.  Now imagine wanting to select all rows whose timestamp is greater than X and then order that result by name.

From what I understand, only one index can be used per table on a given query.  And a multi column index won't help because in this example both columns would need to be in the first position of the index.

Is there an approach that solves this goal of making both the selection and the ordering use an index?

Thanks.