Skip to main content
fix link for current PostGis HP
Source Link
Erwin Brandstetter
  • 182.1k
  • 28
  • 457
  • 620

The right answer is choice #5: use PostGISPostGIS. An example from OpenGeo:

"Note the magic <-> operator in the ORDER BY clause. This is where the magic occurs. The <-> is a “distance” operator, but it only makes use of the index when it appears in the ORDER BY clause. Between putting the operator in the ORDER BY and using a LIMIT to truncate the result set, we can very very quickly (less than 10ms on a 2M record table, in this case) get the 10 nearest points to our test point."

(emphasis added)

The right answer is choice #5: use PostGIS. An example from OpenGeo:

"Note the magic <-> operator in the ORDER BY clause. This is where the magic occurs. The <-> is a “distance” operator, but it only makes use of the index when it appears in the ORDER BY clause. Between putting the operator in the ORDER BY and using a LIMIT to truncate the result set, we can very very quickly (less than 10ms on a 2M record table, in this case) get the 10 nearest points to our test point."

(emphasis added)

The right answer is choice #5: use PostGIS. An example from OpenGeo:

"Note the magic <-> operator in the ORDER BY clause. This is where the magic occurs. The <-> is a “distance” operator, but it only makes use of the index when it appears in the ORDER BY clause. Between putting the operator in the ORDER BY and using a LIMIT to truncate the result set, we can very very quickly (less than 10ms on a 2M record table, in this case) get the 10 nearest points to our test point."

(emphasis added)

Source Link
Daniel Lyons
  • 824
  • 1
  • 7
  • 15

The right answer is choice #5: use PostGIS. An example from OpenGeo:

"Note the magic <-> operator in the ORDER BY clause. This is where the magic occurs. The <-> is a “distance” operator, but it only makes use of the index when it appears in the ORDER BY clause. Between putting the operator in the ORDER BY and using a LIMIT to truncate the result set, we can very very quickly (less than 10ms on a 2M record table, in this case) get the 10 nearest points to our test point."

(emphasis added)