-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Fredrik Larsen
Gesendet: Donnerstag, 19. September 2019 17:29
An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Betreff: Re: [sqlite] [EXTERNAL] Group-by and order-by-desc does not work as 
expected
...
Hick; ORDER BY x DESC >is< covered by index. Btree-indexes allows traversal 
both ways. You can see this if you remove GROUP_BY.
...

True and nothing new, but not the point.

After doing GROUP BY x over the covering index, the result rows would be 
returned by x ASC. There is no index on the rowset returned by the GROUP BY, as 
the rows only exist one at a time. Therefore, the only way to get them into 
ORDER BY X DESC is to sort them.

Gunter


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to