On Thu, Mar 04, 2004 at 12:42:23 +0200,
Elinor Medezinski <elinor(at)bellatrix(dot)tau(dot)ac(dot)il> wrote:
> 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.
In response to
pgsql-novice by date
|Next:||From: stm23||Date: 2004-03-10 04:44:56|
|Subject: pgsql server package|
|Previous:||From: george young||Date: 2004-03-10 01:51:23|
|Subject: Re: SQL Query - Performance Problem|