Own index methods

Started by Benjamin Schallerover 5 years ago5 messages
#1Benjamin Schaller
benjamin.schaller@s2018.tu-chemnitz.de

Hi,

in the Postgres documentation it says: "PostgreSQLprovides the index
methods B-tree, hash, GiST, SP-GiST, GIN, and BRIN. Users can also
define their own index methods, but that is fairly complicated."
(https://www.postgresql.org/docs/12/sql-createindex.html)

Even though it's described as fairly complicated: If I would want to
define my own index method, what would be a good approach to do so?

Best regards

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Benjamin Schaller (#1)
Re: Own index methods

Benjamin Schaller <benjamin.schaller@s2018.tu-chemnitz.de> writes:

Even though it's described as fairly complicated: If I would want to
define my own index method, what would be a good approach to do so?

contrib/bloom would make a sensible template, perhaps.

regards, tom lane

#3Andrey M. Borodin
x4mmm@yandex-team.ru
In reply to: Benjamin Schaller (#1)
Re: Own index methods

Hi!

5 мая 2020 г., в 17:21, Benjamin Schaller <benjamin.schaller@s2018.tu-chemnitz.de> написал(а):

Even though it's described as fairly complicated: If I would want to define my own index method, what would be a good approach to do so?

I'm working on presentation describing how to fork AM out of core to extension. Hope to be available soon. I'll send you a link when it's available.

This small code copy-pasting helps to narrow focus (postgres codebase is big), makes experiments with new not yet committed features easier and allows to "specialise" generic indexes more precisely.

Best regards, Andrey Borodin.

#4Alexander Korotkov
a.korotkov@postgrespro.ru
In reply to: Tom Lane (#2)
Re: Own index methods

On Tue, May 5, 2020 at 5:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Benjamin Schaller <benjamin.schaller@s2018.tu-chemnitz.de> writes:

Even though it's described as fairly complicated: If I would want to
define my own index method, what would be a good approach to do so?

contrib/bloom would make a sensible template, perhaps.

+1

You can also take a look at https://github.com/postgrespro/rum

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

#5Michael Paquier
michael@paquier.xyz
In reply to: Alexander Korotkov (#4)
Re: Own index methods

On Wed, May 06, 2020 at 11:14:49AM +0300, Alexander Korotkov wrote:

You can also take a look at https://github.com/postgrespro/rum

Please note that we have also an extra, mostly-blank, template as of
src/test/modules/dummy_index_am/ which has been added in v13 for
mainly testing purposes, but you can use it as a base for any new
stuff you are willing to try.
--
Michael