On 6/27/2011 11:18 AM, Mohit Sindhwani wrote: > We felt that the query was a bit slow: > > select * FROM Objects, Objects_Index > WHERE Objects.id = Objects_Index.id > AND minx<= 668632 + 250 AND maxx>= 668632 - 250 > AND miny<= 1518661 + 250 AND maxy>= 1518661 - 250 > AND CAT=25; > > Doing an explain query plan revealed that SQlite was scanning Objects > with the IDX_OBJ_CAT first and then using the R-Tree. Without > restricting by CAT, we found the query was much faster and was using > only the virtual R-Tree index.
You can suppress the index on CAT with a unary plus operator, like this: ... AND +CAT=25; -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users