Re: custom index - Mailing list pgsql-general

From Simon Riggs
Subject Re: custom index
Date
Msg-id 1267530808.20134.9723.camel@ebony
Whole thread Raw
In response to custom index  (michael uwe maier <gtrw23@web.de>)
List pgsql-general
On Mon, 2010-03-01 at 14:52 +0100, michael uwe maier wrote:

>   i want to develop an index for a special problem.
>   The postgres docs shows the necessary bits in
>   http://www.postgresql.org/docs/8.4/interactive/indexam.html
>   especially paragraph 50.2 "Index Access Method Functions".
>
>   Now my question: can i use the (documented) Server Programming
>   interface within this functions (e.g. SPI_exec within ambuild)
>   or do i need to use other (possibly undocumented) functions.
>   Background: The index needs some metadata which can be created
>   within "normal" tables. Otherwise this information must be built
>   within the index.

Yes. There isn't any other way to pass user-defined metadata to an index
at build time. "Storage parameters" exist, but these aren't user
extensible, yet.

Using SQL within anything other than ambuild would cause the index to be
volatile and likely to be non-useful.

>   And as an appendix to my question: Are there any (simple) examples
>   for custom indexes ?

Look at hash indexes.

That is somewhat simpler because of the lack of transaction logging.

--
 Simon Riggs           www.2ndQuadrant.com


pgsql-general by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Putting index entries to XLog
Next
From: AI Rumman
Date:
Subject: need a query