rfd: multi-key GiST index problems - Mailing list pgsql-bugs

From Oleg Bartunov
Subject rfd: multi-key GiST index problems
Date
Msg-id Pine.GSO.4.33.0105231830100.8199-100000@ra.sai.msu.su
Whole thread Raw
Responses Re: rfd: multi-key GiST index problems
List pgsql-bugs
Tom,

we're hardly working on multi-key support in GiST and horizon is
being closer :-) I'd like to raise several questions:

1. index_getprocid (backend/access/index/idexam.c) doesn't
   properly supports multi-keys indexes with procnum > 1
   it's works only if either procnum=1 (B-tree, hash) or attnum=1
   (Rtree,Gist,hash). But for multi-key GiST we have
   7>=procnum >=1 and attnum > 1

   We've found workaround for GiST by using define, but general solution
   requires knowledge of the number of procedures for given type of index
   We didn't find a place where this number is stored in the index structure.
   if it's not index it's necessary to add it to the index structure.

2. it's necessary to recognize if index attribute requires checking
   for lossines. Consider following:
   create index a on table using gist(a gist__int_ops) with (islossy);
   create index b on table using gist(b gist_box_ops);

   create index c on table using gist(b gist_box_ops,a gist__int_ops) with (islossy);

   gist__int_ops uses compression with lossy, so we need to check heap tuple
   after successful checking of index tuple, but gist_box_ops doesn't
   requires such test. In third example with multi-key index we
   forced to use 'with (islossy)' for all index even if select will
   use index by first attribute (b gist_box_ops) which is a not right
   thing.
   We'd like to specify lossy attribute for each attribute of index
   something like:
   create index c on table using gist(b gist_box_ops,a gist__int_ops with (islossy));
   Accordingly executor should understand and process this syntax.

Current status:

we could create multi-key GiST index and search is working for 1st attribute
as in current version. there is a problem with searching on next attributes
because currently StrategyNumber (contains, overlap, less ..etc) doesn't
determined for these attributes. StrategyNumber is used for method
Consistence. We hope to resolve this problem.

    Regards,
        Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dumpall in post
Next
From: Tom Lane
Date:
Subject: Re: rfd: multi-key GiST index problems