That index will not result in the ordering you asked for.
--- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-----Original Message----- >From: sqlite-users [mailto:sqlite-users- >[email protected]] On Behalf Of x >Sent: Saturday, 24 March, 2018 13:08 >To: SQLite mailing list >Subject: Re: [sqlite] Determine sort order of query > >sqlite> create table t1(a, b text); >sqlite> create table t2(c, d text); >sqlite> create index b on t1(b); >sqlite> create index d on t2(d); >sqlite> explain query plan select * from t1,t2 order by b, d, >t1.RowID, t2.RowID; >0|0|0|SCAN TABLE t1 USING INDEX b >0|1|1|SCAN TABLE t2 >0|0|0|USE TEMP B-TREE FOR RIGHT PART OF ORDER BY > >Is there a reason it uses TEMP B-TREE rather than index t2(d) ? > >_______________________________________________ >sqlite-users mailing list >[email protected] >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

