Re: [HACKERS] Surjective functional indexes - Mailing list pgsql-hackers

From Konstantin Knizhnik
Subject Re: [HACKERS] Surjective functional indexes
Date
Msg-id 32bb7b6e-b138-9a7c-e74b-7af1365ec4ee@postgrespro.ru
Whole thread Raw
In response to Re: [HACKERS] Surjective functional indexes  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: [HACKERS] Surjective functional indexes  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Re: [HACKERS] Surjective functional indexes  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers

On 22.03.2018 23:37, Alvaro Herrera wrote:
> The rd_projidx (list of each nth element in the index list that is a
> projection index) thing looks odd.  Wouldn't it make more sense to have
> a list of index OIDs that are projection indexes?
>

rd_projidx is not a list, it is Bitmapset. It is just one of many bitmap 
sets in RelationData:

     Bitmapset  *rd_indexattr;    /* identifies columns used in indexes */
     Bitmapset  *rd_keyattr;        /* cols that can be ref'd by foreign 
keys */
     Bitmapset  *rd_pkattr;        /* cols included in primary key */
     Bitmapset  *rd_idattr;        /* included in replica identity index */

Yes, it is possible to construct Oid list of projectional indexes 
instead of having bitmap which marks some indexes in projectional, but I 
am not sure that
it will be more efficient both from CPU and memory footprint point of 
view (in most indexes bitmap will consists of just one integer). In any 
case, I do not think that it can have some measurable impact on 
performance or memory size:
number of indexes and especially projectional indexes will very rarely 
exceed 10.


-- 

Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



pgsql-hackers by date:

Previous
From: Jaime Soler
Date:
Subject: Re: GSOC 2018 Ideas
Next
From: Alvaro Herrera
Date:
Subject: Re: Do I understand commit timestamps correctly?