Re: Radial searches of cartesian points?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: thatsanicehatyouhave(at)mac(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Radial searches of cartesian points?
Date: 2012-01-05 17:54:19
Message-ID: CAHyXU0zqbxLXT5h8CQtbWt1L=1V-xEvvw8BiSP0YYUu+Dk=D2A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 5, 2012 at 11:01 AM, <thatsanicehatyouhave(at)mac(dot)com> wrote:
> Hi,
>
> I have a data set of several hundred thousand points. Each point is saved as a three dimensional coordinate, i.e. (x, y, z). What I'd like to do is given a point in that space, get a list of all of the points in the table within some radius.
>
> I'm familiar with the q3c package that does this for points that lie on a sphere, but is there something comparable for radial searches on 3D cartesian points? Speed is definitely an issue given the number of points I have.
>
> Thanks for any suggestions!

see:
http://www.postgresql.org/docs/9.1/interactive/cube.html

and pay special attention to gist indexing portions. cube only
indexes box operations, but you can cull the sphere using 3d distance
formula for points between inner and outer bounding cube.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message 'Isidor Zeuner' 2012-01-05 21:19:02 Re: handling out of memory conditions when fetching row descriptions
Previous Message thatsanicehatyouhave 2012-01-05 17:01:06 Radial searches of cartesian points?