Covering GiST indexes

От: Andrey Borodin
Тема: Covering GiST indexes
Дата: ,
Msg-id: 73A1A452-AD5F-40D4-BD61-978622FF75C1@yandex-team.ru
(см: обсуждение, исходный текст)
Ответы: Re: Covering GiST indexes  (Teodor Sigaev)
Re: Covering GiST indexes  (Alexander Korotkov)
Re: Covering GiST indexes  (Peter Geoghegan)
Список: pgsql-hackers

Скрыть дерево обсуждения

Covering GiST indexes  (Andrey Borodin, )
 Re: Covering GiST indexes  (Teodor Sigaev, )
  Re: Covering GiST indexes  (Aleksander Alekseev, )
  Re: Covering GiST indexes  (Andrey Borodin, )
   Re: Covering GiST indexes  (Andrey Borodin, )
    Re: Covering GiST indexes  (Thomas Munro, )
     Re: Covering GiST indexes  (Andrey Borodin, )
      Re: Covering GiST indexes  (Thomas Munro, )
       Re: Covering GiST indexes  (Andrey Borodin, )
        Re: Covering GiST indexes  (Dmitry Dolgov, )
         Re: Covering GiST indexes  (Andrey Borodin, )
          Re: Covering GiST indexes  (Andreas Karlsson, )
           Re: Covering GiST indexes  (Andrey Borodin, )
            Re: Covering GiST indexes  (Andreas Karlsson, )
             Re: Covering GiST indexes  (Andrey Borodin, )
              Re: Covering GiST indexes  (Andreas Karlsson, )
               Re: Covering GiST indexes  (Andreas Karlsson, )
               Re: Covering GiST indexes  (Andrey Borodin, )
                Re: Covering GiST indexes  (Andreas Karlsson, )
                 Re: Covering GiST indexes  (Andrey Borodin, )
                  Re: Covering GiST indexes  (Andreas Karlsson, )
                   Re: Covering GiST indexes  (Alexander Korotkov, )
                    Re: Covering GiST indexes  (Alexander Korotkov, )
                     Re: Covering GiST indexes  (Andrey Borodin, )
 Re: Covering GiST indexes  (Alexander Korotkov, )
  Re: Covering GiST indexes  (Darafei "Komяpa" Praliaskouski, )
   Re: Covering GiST indexes  (Alexander Korotkov, )
 Re: Covering GiST indexes  (Peter Geoghegan, )

Hi, hackers!

Looks like we finally have covering indexes! And that's cool!

So I decided to create a thread to discuss covering GiST indexes.
Here's a prototype patch implementing this functionality.
It is quite small (+80 -30) and lacks tests and docs. But it creates a context.

I have two concerns.
First one is about INDEX_AM_RESERVED_BIT.
B-tree uses it as a base for prefix truncation (I'm not quite sure why it is usually called suffix truncation, but this
isa matter for other thread). 
GiST , probably, will not use [pre\su]fix truncation. But I'd like to use that 13th bit to implement intra-page
indexing- a way to improve search within gist page. See [0,1] 

Second, currently including indexes do not allow same attributes in both keys and include parts.
# create index on x using gist(c) include (c);
ERROR:  included columns must not intersect with key columns

But it makes sense for example for geometries like PostGIS. Index keys are truncated to small MBRs while having whole
complexgeometry right in an index could be handy. 

Any feedback will be appreciated.

Best regards, Andrey Borodin.


[0] https://www.postgresql.org/message-id/7780A07B-4D04-41E2-B228-166B41D07EEE%40yandex-team.ru
[1] https://www.postgresql.org/message-id/CAJEAwVE0rrr+OBT-P0gDCtXbVDkBBG_WcXwCBK=

Вложения

В списке pgsql-hackers по дате сообщения:

От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Runtime Partition Pruning
От: Peter Geoghegan
Дата:
Сообщение: Re: Covering GiST indexes