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) &^£@! 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