On Sun, Mar 2, 2014 at 1:55 PM, big stone <stonebi...@gmail.com> wrote:

>    ==> Why such a 'x6' speed-up, as we need to scan the whole table anyway
> ?
>

SQLite implements GROUP BY by sorting on the terms listed in the GROUP BY
clause.  Then as each row comes out, it compares the GROUP BY columns to
the previous row to see if a new "group" needs to be started.  Sorting is
O(NlogN) if you don't have an index.


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to