GiST indexing tuples

From: Matthew <matthew(at)flymine(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: GiST indexing tuples
Date: 2007-11-27 18:28:23
Message-ID: Pine.LNX.4.58.0711271811460.3731@aragorn.flymine.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


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) USING fancy_new_index;

and then:

SELECT * FROM table WHERE a > 1 AND b < 4;

and have that answered by the index.

Now, generating an index format that can answer that particular
arrangement of constraints is easy. I can do that. However, getting
multiple values into the GiST functions is something I don't know how to
do. As far as I can see, I would need to create a composite type and index
that, like the contrib package seg does. This would change my SQL to:

CREATE INDEX range_index ON table(fancy_type(a, b)) USING fancy_index;

SELECT * FROM table WHERE fancy_type(a, b) &^£(at)! fancy_type(1, 4);

which I don't want to do.

So, has this problem been solved before? Is there an already-existing
index that will speed up my query? Is there a way to get more than one
value into a GiST index?

Thanks,

Matthew

--
If you let your happiness depend upon how somebody else feels about you,
now you have to control how somebody else feels about you. -- Abraham Hicks

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Steinar H. Gunderson 2007-11-27 18:38:55 Re: GiST indexing tuples
Previous Message cluster 2007-11-27 18:21:38 Re: Query only slow on first run