Another addendum: apologies <red-face emoticon> -- I hope my discussion was clear enough despite the disconnect between my head and my fingers; I just noticed that I had typed "INNER JOIN" (yikes) rather than "INNER LOOP", by which I mean fetching the rowids using an index (on LATITUDE say) and then having to loop through those rowids in order to fetch rows from the base table to compare the LONGITUDE.
If INTERSECT could be optimized would this form of query: select rowid from T where {latitude criteria} INTERSECT select rowid from T where {longitude criteria) ever be faster than a query that uses a single index followed by a looping read of the base table: select rowid from T where lat >= ? and lon <= ? and lat <= ? and lon >= ? Regards Tim Romano _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users