Re: [PERFORM] gist indexes for distance calculations

2010-10-11 Thread Robert Haas
On Fri, Oct 1, 2010 at 1:56 AM, Jesper Krogh wrote: > On 2010-09-30 20:33, Marcelo Zabani wrote: >> >> If you can also pinpoint me to where I can find this sort of information >> (index utilization and planning, performance tuning), I'd be very >> grateful. >> Thank you already, >> > > Isn't this

Re: [PERFORM] gist indexes for distance calculations

2010-10-01 Thread Marcelo Zabani
Thanks a lot everyone for all the info! It is all really helpful. 2010/10/1 Merlin Moncure > On Thu, Sep 30, 2010 at 2:33 PM, Marcelo Zabani > wrote: > > Hi everyone. I have a question, and it's well beyond me to even speculate > > about the inner workings of postgresql on this. > > > > I hav

Re: [PERFORM] gist indexes for distance calculations

2010-10-01 Thread Merlin Moncure
On Thu, Sep 30, 2010 at 2:33 PM, Marcelo Zabani wrote: > Hi everyone. I have a question, and it's well beyond me to even speculate > about the inner workings of postgresql on this. > > I have a "places" table, and a "coordinates" column, of type POINT. > > If I want to find every place within, for

Re: [PERFORM] gist indexes for distance calculations

2010-09-30 Thread Jesper Krogh
On 2010-09-30 20:33, Marcelo Zabani wrote: If you can also pinpoint me to where I can find this sort of information (index utilization and planning, performance tuning), I'd be very grateful. Thank you already, Isn't this what the knngist patches are for? https://commitfest.postgresql.org/a

Re: [PERFORM] gist indexes for distance calculations

2010-09-30 Thread Karim Nassar
> > Thanks a lot for all the help, if you can lead me to any docs/articles, > I'll gladly read them. I found this: http://en.wikipedia.org/wiki/R-tree Looks like what Tom was talking about, ja? Karim

Re: [PERFORM] gist indexes for distance calculations

2010-09-30 Thread Marcelo Zabani
So let me see if I understand, when searching for everyone within radius "r" of point (a,b), the gist index will be used like this: * C is the circle centered on (a,b) of radius "r" 1. Traverse down the tree, starting at the root. Only go down nodes whose bounding-box has a non-empty intersection

Re: [PERFORM] gist indexes for distance calculations

2010-09-30 Thread Tom Lane
Marcelo Zabani writes: > CREATE INDEX ON places USING gist (circle(coordinates, 1)); > I'd like to know how this index works, though, as it seems to me the only > way to have this kind of index to work is to calculate the distance of every > point in a square of sides 2*1=2 units centered on (a,

[PERFORM] gist indexes for distance calculations

2010-09-30 Thread Marcelo Zabani
Hi everyone. I have a question, and it's well beyond me to even speculate about the inner workings of postgresql on this. I have a "places" table, and a "coordinates" column, of type POINT. If I want to find every place within, for example, a distance of 1 unit from an arbitrary point, I'll do: