skywind mailing lists wrote: > Assume I have the following tables: > > CREATE TABLE A (ID INTEGER PRIMARY KEY, Latitude, Longitude, Altitude); > CREATE VIRTUAL TABLE B USING RTree (ID, FromLatitude, TillLatitude, > FromLongitude,TillLongitude); > > According to the RTree documentation this query should be fast (demo_data / > demo_index example): > > SELECT COUNT(*) FROM A,B WHERE (A.ID=B.ID) AND (FromLongitude > 5) AND > (TillLongitude < 10); > > Actually, the query is pretty slow.
According to the EXPLAIN QUERY PLAN output (<http://www.sqlite.org/eqp.html>), it is fast: 0|0|1|SCAN TABLE B VIRTUAL TABLE INDEX 2:EcCd 0|1|0|SEARCH TABLE A USING INTEGER PRIMARY KEY (rowid=?) To you get the same output for EXPLAIN QUERY PLAN? If not, what SQLite version are you using? Regards, Clemens _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users