Re: find close (duplicate) points + create index - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: find close (duplicate) points + create index
Date
Msg-id 20040310041624.GB31629@wolff.to
Whole thread Raw
In response to find close (duplicate) points + create index  (Elinor Medezinski <elinor@bellatrix.tau.ac.il>)
List pgsql-novice
On Thu, Mar 04, 2004 at 12:42:23 +0200,
  Elinor Medezinski <elinor@bellatrix.tau.ac.il> wrote:
> Hello,
>
> I have a table with one column --
> "CREATE TABLE pointtable (point POINT)".
> I'm trying to find duplicate entries, where two entries are considered
> duplicates if  they're within a radius of 1, meaning something like ~ "select
> point from pointtable where distance between points <=1".
> Obviously this is not SQL syntax. Is there a way to do this - search within a
> column itself?

Yes, you can join a table to itself and return records matching some
critera. This isn't going to be fast. I didn't see a distance between
two points function, but it is probably there somewhere. If not you
can check if one point is contained in a circle of radius 1 centered
at the other point. This is something that could use an index, though
it probably wouldn't help when checking the whole table. It probably
would speed up checking a single point for conflicts.

pgsql-novice by date:

Previous
From: george young
Date:
Subject: Re: SQL Query - Performance Problem
Next
From: stm23
Date:
Subject: pgsql server package