arq5x/gemini — pull request #204 by roryk (2013-08-23 18:59:53+00:00)
Title: Remove ORDER BY.

Hi Aaron and Uma,

These queries fail with out an out of disk space error for very large databases; I know very little about sqlite, but it seems like if the database is created with journaling in memory, if it has to write a large temporary table it will run out of memory. I was getting: SQLite error: database or disk is full errors running these queries, even with my tmp dir set to filesystems with 100T plus of space. Removing ORDER BY seems to fix it; https://www.sqlite.org/tempfiles.html kind of indicates in passing that a temporary table will be created for ORDER BY clauses. I think the solution would be either to not set the journaling to be in memory or to remove ORDER BY clauses where the result might be very large. I'm pull requesting to see what you think.