0

I have a table with three columns namely username, latitude and longitude. My queries are going to be range queries for latitude and longitude together. Should I use a single column index or multicolumn index. What are the performance advantages and disadvantages for both?

ffff
  • 2,853
  • 1
  • 25
  • 44
  • Usually multicolumn index is better and single-column is not necessary. If your DB support GEO data-types, probably that is even better. Though if you are in doubt, make performance tests on your setup. – Gábor Bakos Jun 04 '15 at 13:03
  • Easiest thing to do is to create the table, fill it with 1 million records and then check how it behaves when you index each column vs multicolumn index. Heck, you might even index both columns and then add another index that's multicolumn if your use case is such that you can benefit from both. – N.B. Jun 04 '15 at 13:38

0 Answers0