Christophe Leske wrote: > There is virtually no difference in using indices or not in my query. > > I also tried to reformulate my statement in order not to use BETWEEN but > a sandwiched > and < statement: > > SELECT * FROM Cities WHERE class_dds<11 and (longitude_DDS BETWEEN > 6.765103 and 7.089129) AND (latitude_DDS BETWEEN 44.261771 and > 44.424779) ORDER BY class_dds ASC Limit 20 > > became > > SELECT * FROM Cities WHERE class_dds<11 and (longitude_DDS>6.765103 and > longitude_DDS<7.089129) AND (latitude_DDS>44.261771 and > latitude_DDS<44.424779) ORDER BY class_dds ASC Limit 20 > > > The timing with a latlon index (latitude and longitude indexed): > TIME:2814 ms > > The timing with just one index (latitude): > TIME:2797 ms > > Timing with two indices (latitude and longitude separetly): > TIME:2787 ms > > > Timing with two indices (lat/lon) and the reformulated query above: > TIME:2763 ms > > >
Question, have you tried an index on class_dds, longitude_DDS, and latitude_DDS? CREATE INDEX tableidx ON table (class_dds, longitude_DDS, latitude_DDS); Since all three fields are used in the query, I am curious if that would help in any way. John _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users