473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Index on points

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

which operator class can I use in order to search points by distance like in:

SELECT p FROM tbl WHERE (p <-> point(0,0)) < 10;

- From what I've seen, there is none - which surprises me ...

Mit freundlichem Gruß / With kind regards
Holger Klawitter
- --
lists <at> klawitter <dot> de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAxa561Xdt0HKSwgYRAriFAJ4jiNya++OcM8LuQbl/nhhjiKcQywCfeeUj
FuMLsNgpOR0totwbDfp68SM=
=R1om
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
4 1319
On Tue, Jun 08, 2004 at 14:17:57 +0200,
Holger Klawitter <li***@klawitter.de> wrote:

Hi there,

which operator class can I use in order to search points by distance like in:

SELECT p FROM tbl WHERE (p <-> point(0,0)) < 10;

- From what I've seen, there is none - which surprises me ...


You want to create a box that includes all points that might match
and use that to do an index search (using an rtree index) and then
check that the distance is really less than whatever.

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
On Tue, Jun 08, 2004 at 14:17:57 +0200,
Holger Klawitter <li***@klawitter.de> wrote:

Hi there,

which operator class can I use in order to search points by distance like in:

SELECT p FROM tbl WHERE (p <-> point(0,0)) < 10;

- From what I've seen, there is none - which surprises me ...


You want to create a box that includes all points that might match
and use that to do an index search (using an rtree index) and then
check that the distance is really less than whatever.

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!
SELECT p FROM tbl WHERE (p <-> point(0,0)) < 10;

You want to create a box that includes all points that might match
and use that to do an index search (using an rtree index) and then
check that the distance is really less than whatever.


Thanks for the hint!
I was just too confused about the lack of point operators to think about
alternatives...

Mit freundlichem Gruß / With kind regards
Holger Klawitter
- --
lists <at> klawitter <dot> de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAxc2h1Xdt0HKSwgYRAl47AJ0XF49Mr8OgPSwM5uULTO cp3nGVAgCfWWp9
NBrsrP1Fnu2+UCo63niQzjQ=
=/7qF
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!
SELECT p FROM tbl WHERE (p <-> point(0,0)) < 10;

You want to create a box that includes all points that might match
and use that to do an index search (using an rtree index) and then
check that the distance is really less than whatever.


Thanks for the hint!
I was just too confused about the lack of point operators to think about
alternatives...

Mit freundlichem Gruß / With kind regards
Holger Klawitter
- --
lists <at> klawitter <dot> de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAxc2h1Xdt0HKSwgYRAl47AJ0XF49Mr8OgPSwM5uULTO cp3nGVAgCfWWp9
NBrsrP1Fnu2+UCo63niQzjQ=
=/7qF
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jofio | last post by:
Hello, I am a newbie in PHP and I am enthusiastically trying out things. I've just replaced my index.html ( file with index.php
2
by: David Schwartz | last post by:
We are having quite a time since moving a large database to a new server (actually built new server, renamed as old to make seamless for users, etc.) Import 104 million row database (5 column)...
1
by: Average Bear | last post by:
If anyone could help with this one, I am a bit puzzled. I understand you can create an index using two fields of a database, then use the seek method to find a record based on both fields. My...
11
by: ike | last post by:
Could you please give your opinion on the portability of this code? /* -------- begin findindex.c -------- */ struct Foo { int junk0; }; struct Bar { int junk1; struct Foo foo; int junk2; }; ...
6
by: David Osborn | last post by:
I have a pointer "a" that points to an element in an array that is not the first element. I want to use a negative index to derefence the pointer, like so: a. Is this valid C99? If not, I can...
30
by: Eric Lilja | last post by:
Hello, I have a function that has a static array with two elements in it. When the function is called the first time, it should access element 0, the second time it should access element 1, the...
8
by: rcamarda | last post by:
I thought I would delve into index fragmentation and I found some great sql from many posters (thanks Erland!). My question is how bad is bad? I know this is very subjective. Some scripts I found...
122
by: C.L. | last post by:
I was looking for a function or method that would return the index to the first matching element in a list. Coming from a C++ STL background, I thought it might be called "find". My first stop was...
6
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.