From: Bruno Wolff III <bruno@wolff.to>
To: Virgile Beddok <virgile.beddok@igd.fraunhofer.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: pgsql-novice@postgresql.org
Cc: pgsql-advocacy@postgresql.org
Subject: Re: [NOVICE] Function which gives back the
Date: Sun, 3 Apr 2005 07:14:52 -0500
Message-ID: <20050403121452.GA27923@wolff.to> (raw)
In-Reply-To: <1343.146.140.8.94.1112027529.squirrel@webmail.igd.fraunhofer.de>
References: <2657.146.140.8.144.1111775776.squirrel@webmail.igd.fraunhofer.de>
<42464392.9040903@familyhealth.com.au>
<20050327163653.GH9280@wolff.to>
<5796.1111941132@sss.pgh.pa.us>
<1218.146.140.8.94.1112025141.squirrel@webmail.igd.fraunhofer.de>
<20050328161240.GD7217@wolff.to>
<1343.146.140.8.94.1112027529.squirrel@webmail.igd.fraunhofer.de>
On Mon, Mar 28, 2005 at 18:32:09 +0200,
Virgile Beddok <virgile.beddok@igd.fraunhofer.de> wrote:
>
> I just want to know if there is an existing and implemented function, or
> tree, in Postgres which allows me to directly perform a "nearest neighbour
> search" on multidimensional vectors.
What precisely do you mean by "nearest"? To answer that question you
need a metric function. A common metric function is euclidean distance.
Another common one is distance along the geodesic connecting two points
on the surface of the sphere.
The cube contrib package has indexing that might be useful for doing lossy
matches if you have some upperbound on how far a part a nearest neighbor
can be in your problem. It even will handle multiple dimensions. (You
haven't even bothered to tell us how many dimensions your points have.)
The earthdistance contrib package has a function for calculating distance
on the surface of sphere and uses the cube package to provide a lossy
way of doing indexed searches.
If you want specific anwsers it would help if you would provide us with
more details about the problem you are trying to solve.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: bruno@wolff.to, virgile.beddok@igd.fraunhofer.de, tgl@sss.pgh.pa.us, chriskl@familyhealth.com.au, pgsql-novice@postgresql.org, pgsql-advocacy@postgresql.org
Subject: Re: [NOVICE] Function which gives back the
In-Reply-To: <20050403121452.GA27923@wolff.to>
References: <2657.146.140.8.144.1111775776.squirrel@webmail.igd.fraunhofer.de> <42464392.9040903@familyhealth.com.au> <20050327163653.GH9280@wolff.to> <5796.1111941132@sss.pgh.pa.us> <1218.146.140.8.94.1112025141.squirrel@webmail.igd.fraunhofer.de> <20050328161240.GD7217@wolff.to> <1343.146.140.8.94.1112027529.squirrel@webmail.igd.fraunhofer.de> <20050403121452.GA27923@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