Re: [PERFORM] GiST indexing tuples

2007-11-30 Thread Matthew
On Thu, 29 Nov 2007, Matthew T. O'Connor wrote: > Matthew wrote: > > For instance, the normal B-tree index on (a, b) is able to answer queries > > like "a = 5 AND b > 1" or "a > 5". An R-tree would be able to index these, > > plus queries like "a > 5 AND b < 1". > > Sorry in advance if this is a st

Re: [PERFORM] GiST indexing tuples

2007-11-29 Thread Steinar H. Gunderson
On Thu, Nov 29, 2007 at 03:23:10PM -0500, Matthew T. O'Connor wrote: > Sorry in advance if this is a stupid question, but how is this better than > two index, one on "a" and one on "b"? I supposed there could be a space > savings but beyond that? You could index on both columns simultaneously w

Re: [PERFORM] GiST indexing tuples

2007-11-29 Thread Matthew T. O'Connor
Matthew wrote: For instance, the normal B-tree index on (a, b) is able to answer queries like "a = 5 AND b > 1" or "a > 5". An R-tree would be able to index these, plus queries like "a > 5 AND b < 1". Sorry in advance if this is a stupid question, but how is this better than two index, one on

Re: [PERFORM] GiST indexing tuples

2007-11-28 Thread Matthew
On Wed, 28 Nov 2007, Tom Lane wrote: > Have you looked at contrib/seg/ ? Yes, I had a pretty good look at that. However, I believe that in order to use seg's indexes, I would need to put my data into seg's data type, and reformat my query, as I stated in my original message. What I'm looking for i

Re: [PERFORM] GiST indexing tuples

2007-11-28 Thread Tom Lane
Matthew <[EMAIL PROTECTED]> writes: >> This sounds like something an R-tree can do. > I *know* that. However, Postgres (as far as I can see) doesn't provide a > simple R-tree index that will index two integers. This means I have to > write one myself. I'm asking whether it is possible to get two v

Re: [PERFORM] GiST indexing tuples

2007-11-28 Thread Gregory Stark
"Matthew" <[EMAIL PROTECTED]> writes: > On Tue, 27 Nov 2007, Steinar H. Gunderson wrote: >> On Tue, Nov 27, 2007 at 06:28:23PM +, Matthew wrote: >> > SELECT * FROM table WHERE a > 1 AND b < 4; >> >> This sounds like something an R-tree can do. > > I *know* that. However, Postgres (as far as I

Re: [PERFORM] GiST indexing tuples

2007-11-28 Thread Matthew
On Tue, 27 Nov 2007, Steinar H. Gunderson wrote: > On Tue, Nov 27, 2007 at 06:28:23PM +, Matthew wrote: > > SELECT * FROM table WHERE a > 1 AND b < 4; > > This sounds like something an R-tree can do. I *know* that. However, Postgres (as far as I can see) doesn't provide a simple R-tree index t

Re: [PERFORM] GiST indexing tuples

2007-11-27 Thread Steinar H. Gunderson
On Tue, Nov 27, 2007 at 06:28:23PM +, Matthew wrote: > SELECT * FROM table WHERE a > 1 AND b < 4; This sounds like something an R-tree can do. /* Steinar */ -- Homepage: http://www.sesse.net/ ---(end of broadcast)--- TIP 2: Don't 'kill -9' the

[PERFORM] GiST indexing tuples

2007-11-27 Thread Matthew
Hi all. I'm wanting to write a new GiST index system, to improve performance on some queries I am running. I have had quite a look through the docs and code, and I'm not convinced that it is possible to do what I want. This is what I am wanting to index: CREATE INDEX range_index ON table(a, b) U