Making full table scan 10x faster in InnoDB
yoshinorimatsunobu.blogspot.com
yoshinorimatsunobu.blogspot.com
What the fuck?
MySQL does have an implicit ordering on GROUP BY queries, but it is deprecated and should not be relied on.
My favourite ever SQL Server hack was one done by a guy called Jeff Moden, who came up with a running total update that relied on a specific quirk of SQL Server clustered indexes. The amount of effort he put into it is quite remarkable! [1]
1. (Create a temp account to check it out, they're not spammers) http://www.sqlservercentral.com/articles/T-SQL/68467/
As a side note, because of this, secondary indices just have a pointer to a PK. So when looking up by a secondary index, it has to traverse two trees.
sqlite3 stores rows in an integer primary key index. If you do not specify an "integer primary key" column, it synthesizes one behind the scenes (essentially a rowid) and your primary key lookups end up going through two indexes.
Currently digging through Google to see if I can find how those async calls are implemented on Linux/Windows to see if you can expect similar speedups in performance as Yoshinori saw in this article.
[1] http://openjdk.java.net/projects/nio/javadoc/java/nio/channe...
The solution sounds fragile; I guess you can't query by extent?