Performance difference between SELECT ... ORDER BY ... ASC/DESC

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Performance difference between SELECT ... ORDER BY ... ASC/DESC

mailing lists
Hi,

is there in general a performance difference between querying using SELECT … ORDER BY … ASC or DESC? Without an index I believe that the result is the same (sorting has to be done anyway somehow). Using an index it should be also the same but… Are there any examples where DESC is (much) slower than ASC or vice versa?

Regards,
Hartwig

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Performance difference between SELECT ... ORDER BY ... ASC/DESC

Simon Slavin-3
On 3 Aug 2019, at 8:35pm, mailing lists <[hidden email]> wrote:

> is there in general a performance difference between querying using SELECT … ORDER BY … ASC or DESC?

No.  Very close to the same speed.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users