Skip site navigation (1) Skip section navigation (2)

Re: optimizing a geo_distance() proximity query

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Mark Stosberg <mark(at)summersault(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: optimizing a geo_distance() proximity query
Date: 2007-02-04 05:16:44
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Sat, Feb 03, 2007 at 14:00:26 -0500,
  Mark Stosberg <mark(at)summersault(dot)com> wrote:
> I'm using geo_distance() from contrib/earthdistance would like to find a
> way to spend up the geo distance calculation if possible. This is for a
> proximity search: "Show me adoptable pets within 250 miles of this
> zipcode".

If you are using the "cube" based part of the earth distance package,
then you can use gist indexes to speed those searches up. There are
functions for creating boxes that include all of the points some distance
from a fixed point. This is lossy, so you need to recheck if you don't
want some points a bit farther away returned. Also you would need to
pick a point to be where the zip code is located, rather than using area
based zip codes. However, if you have actually addresses you could use the
tiger database to locate them instead of just zip code locations.

In response to


pgsql-performance by date

Next:From: Kirk WythersDate: 2007-02-05 04:29:52
Subject: Re: trouble with a join on OS X
Previous:From: Oleg BartunovDate: 2007-02-03 19:11:51
Subject: Re: optimizing a geo_distance() proximity query

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group