On Mon, Jan 11, 2010 at 12:56 AM, D. Richard Hipp <d...@hwaci.com> wrote:
> > On Jan 10, 2010, at 4:50 AM, Max Vlasov wrote: > > > Documentation says that INTERSECT implemented with temporary tables > > either > > in memory or on disk. Is it always the case? > > No. > > If there is an ORDER BY clause, SQLite may run each subquery as a > separate co-routine and merge the results. Thanks a lot, At the first place I tried to append ORDER BY in every query that led to "ORDER BY clause should come after intersect not before" error, but I did not read this message properly just to place the ORDER BY once at the end of the query. The time improved dramatically from 50 seconds to 6 and it was an extreme case so the real life queries dropped to below a second. Needless to say, but I'm very impressed about how sqlite takes almost every aspect into account _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users