I have two tables with about 100 000 rows. One is the main data table and the other an RTree table.
I started a query like described at http://www.sqlite.org/rtree.html: SELECT data.location_name FROM data, rtree WHERE data.id=rtree.id AND rtree.x >= 0 AND rtree.x <= 10; This runs for about 4 secs. When using this query: SELECT location_name FROM data WHERE id IN (SELECT id FROM rtree WHERE rtree.x >= 0 AND rtree.x <= 10); the result is available after less than 0.4 s. This time I expected also for the first query but it seems to be that something is going wrong overthere (the index for the ID does not seem to be used or something similar). I had a look at the command using "explain" but I am not an expert for the VDBE instructions. Any ideas? Hartwig FYI: the rtree query by itself returns less than 50 rows. FYI: I am using sqlite3 version 3.6.1 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users