[postgis-users] help optimize distance calculation

Ron M rm_postgis at cheapcomplexdevices.com
Wed Jan 28 14:43:49 PST 2009


Sky wrote:
> A query over 400,000 points w/o dwithin took 972 seconds. A query over
> 400,000 points w/ dwithin(25000) took 111 seconds. Nice!
> 
> Sounds like I need to think about my scenario for a bit and figure out
> if I can strike a balance between dwithin tolerance and query
> execution time.

Seems you could make a loop starting with a very small dwithin tolerance and
doubling it in each iteration through a loop.  Hiding this in a stored
procedure would keep the queries clean.



More information about the postgis-users mailing list