From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Christoph Berg <myon@debian.org>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Surjective functional indexes
Date: Fri, 23 Mar 2018 18:39:24 +0300
Message-ID: <32bb7b6e-b138-9a7c-e74b-7af1365ec4ee@postgrespro.ru> (raw)
In-Reply-To: <20180322203743.reucnyd7pelkkxom@alvherre.pgsql>
References: <20180322203743.reucnyd7pelkkxom@alvherre.pgsql>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: k.knizhnik@postgrespro.ru, alvherre@alvh.no-ip.org, sfrost@snowman.net, michael.paquier@gmail.com, simon@2ndquadrant.com, myon@debian.org, thomas.munro@enterprisedb.com, peter.eisentraut@2ndquadrant.com
Subject: Re: [HACKERS] Surjective functional indexes
In-Reply-To: <32bb7b6e-b138-9a7c-e74b-7af1365ec4ee@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox