Monday, December 09, 2019, 1:32:40 PM, Digital Dog
wrote:
> On Sat, Dec 7, 2019 at 3:50 AM Simon Slavin wrote:
>> On 7 Dec 2019, at 2:26am, Shawn Wagner wrote:
>>
>> > The first one uses the index for all sorting, but the second one only
>> uses it for sorting a, not b. I feel like the descen
On Sat, Dec 7, 2019 at 3:50 AM Simon Slavin wrote:
> On 7 Dec 2019, at 2:26am, Shawn Wagner wrote:
>
> > The first one uses the index for all sorting, but the second one only
> uses it for sorting a, not b. I feel like the descending sort could make
> use of the index too, just reading the b sec
On 7 Dec 2019, at 2:26am, Shawn Wagner wrote:
> The first one uses the index for all sorting, but the second one only uses it
> for sorting a, not b. I feel like the descending sort could make use of the
> index too, just reading the b sections backwards to get the right order. Is
> there some
Consider:
sqlite> CREATE TABLE test1(a, b);
sqlite> CREATE INDEX test1_idx ON test1(a, b ASC);
sqlite> EXPLAIN QUERY PLAN SELECT * FROM test1 ORDER BY a, b;
QUERY PLAN
`--SCAN TABLE test1 USING COVERING INDEX test1_idx
sqlite> EXPLAIN QUERY PLAN SELECT * FROM test1 ORDER BY a, b DESC;
QUERY PLAN
|
4 matches
Mail list logo