> Would it be possible for SQLite to notice that the inner order by is unnecessary and ignore it when executing this kind of query? That seems simple, doesn't it. And yet, when I omit the ORDER BY clause from a subquery in the FROM clause that lacks a LIMIT and does not use window functions, I still get 1524 errors from "make test". It will take some time to analyze this and figure out what is going on.