From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Joshua D. Drake <jd@commandprompt.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Indirect indexes
Date: Thu, 20 Oct 2016 11:21:28 -0300
Message-ID: <20161020142128.2qqk7lowoz4ro6wc@alvherre.pgsql> (raw)
In-Reply-To: <2a89563d-99d0-f304-1b0f-1f33bac4fd62@commandprompt.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Joshua D. Drake wrote:
> That said would it be possible to make this index an extension (like rum?).
> Assuming of course we can get any required infrastructure changes done in a
> general way.
Well, the patch I currently have creates a separate index AM called
"ibtree" which is an indirect btree that internally calls the regular
btree code -- pretty much what you propose. I think it can work that
way, but it's not as efficient as it can be done if the feature is
incorporated into core. There are things like obtaining the primary key
value from the indexed tuple: in my extension I simply do "heap_fetch"
to obtain the heap tuple, then heap_getattr() to obtain the values from
the primary key columns. This works, but if instead the executor passes
the primary key values as parameters, I can save both those steps, which
are slow.
Now if we do incorporate the infrastructure changes in core in a general
way, which is what I am proposing, then the in-core provided btree AM
can do indirect indexes without any further extension. The same
infrastructure changes can later provide support for GIN indexes.
> I do think the feature has merit.
Thanks.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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: alvherre@2ndquadrant.com, jd@commandprompt.com, bruce@momjian.us, simon@2ndquadrant.com, pavan.deolasee@gmail.com, a.korotkov@postgrespro.ru, robertmhaas@gmail.com
Subject: Re: Indirect indexes
In-Reply-To: <20161020142128.2qqk7lowoz4ro6wc@alvherre.pgsql>
* 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