Is there any performance gain or loss from stuffing two columns into one
index, e.x.

   CREATE INDEX `myindex1` ON `nodes` (`n_lat`, `n_lon`);

compared to:

   CREATE INDEX `myindex2` ON `nodes` (`n_lat`);
   CREATE INDEX `myindex3` ON `nodes` (`n_lon`);

when doing a query like this:

   SELECT * FROM nodes
   WHERE n_lat >= 51 AND n_lon >= -1 AND n_lat <= 53 AND n_lon <= 1;

Will SQLite do more or less work on either? Or are they virtually equivalent?

I have been trying to get R*-Trees working and I have had limited success
with my roads database but nodes do not want to cooperate, getting
Constraint Errors all around.

Also, is a UNIQUE index faster to read than a non-UNIQUE index in any way?

Unfortunately, I am struggling to test this myself, as my only datasets
available are 1-2 GB (XML) and these take about 2-3 hours to load into
SQLite using a short Python program.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to