pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Mark Stosberg <mark@summersault.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: optimizing a geo_distance() proximity query
Date: Sat, 3 Feb 2007 23:16:44 -0600
Message-ID: <20070204051644.GA3754@wolff.to> (raw)
In-Reply-To: <eq2m5o$8cr$1@sea.gmane.org>
References: <eq2m5o$8cr$1@sea.gmane.org>

On Sat, Feb 03, 2007 at 14:00:26 -0500,
  Mark Stosberg <mark@summersault.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.



view thread (9+ messages)  latest in thread

Message-ID: <20070204051644.GA3754@wolff.to>
Permalink:  ../20070204051644.GA3754@wolff.to/
Also on:    postgresql.org/message-id/20070204051644.GA3754@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: bruno@wolff.to, mark@summersault.com
  Subject: Re: optimizing a geo_distance() proximity query
  In-Reply-To: <20070204051644.GA3754@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox