[sqlite] ORDER BY DESC after GROUP BY not using INDEX - intentionally?

2013-10-21 Thread Fabian Büttner
Hi, I have been thinking about a question on stackoverflow (http://stackoverflow.com/questions/19236363/select-distinct-faster-than-group-by), where some SQL framework removes duplicates from results using GROUP BY instead of DISTINCT. I don't want to discuss that this might not be a good

Re: [sqlite] ORDER BY DESC after GROUP BY not using INDEX - intentionally?

2013-10-21 Thread Richard Hipp
On Mon, Oct 21, 2013 at 5:27 AM, Fabian Büttner fabian.buett...@gmx.orgwrote: Hi, I have been thinking about a question on stackoverflow ( http://stackoverflow.com/**questions/19236363/select-**

Re: [sqlite] ORDER BY DESC after GROUP BY not using INDEX - intentionally?

2013-10-21 Thread Yuriy Kaminskiy
Fabian Büttner wrote: Hi, I have been thinking about a question on stackoverflow (http://stackoverflow.com/questions/19236363/select-distinct-faster-than-group-by), where some SQL framework removes duplicates from results using GROUP BY instead of DISTINCT. I don't want to discuss that

Re: [sqlite] ORDER BY DESC after GROUP BY not using INDEX - intentionally?

2013-10-21 Thread Fabian Büttner
Thanks. I think using GROUP BY without aggregates is a strange way to remove duplicates, anyway. Not intentional. SQLite simply fails to recognize that by using the GROUP BY in descending order it could avoid the ORDER BY clause. This is an optimization that we have never considered because it