Re: Sequence Access Method WIP - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Sequence Access Method WIP
Date
Msg-id 5286631E.1000406@vmware.com
Whole thread Raw
In response to Re: Sequence Access Method WIP  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Sequence Access Method WIP  (Andres Freund <andres@2ndquadrant.com>)
Re: Sequence Access Method WIP  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On 14.11.2013 22:10, Simon Riggs wrote:
> On 16 January 2013 00:40, Simon Riggs <simon@2ndquadrant.com> wrote:
>
>> SeqAm allows you to specify a plugin that alters the behaviour for
>> sequence allocation and resetting, aimed specifically at clustering
>> systems.
>>
>> New command options on end of statement allow syntax
>>    CREATE SEQUENCE foo_seq
>>        USING globalseq
>
> Production version of this, ready for commit to PG 9.4
>
> Includes test extension which allows sequences without gaps - "gapless".
>
> Test using seq_test.psql after creating extension.
>
> No dependencies on other patches.

It's pretty hard to review the this without seeing the "other" 
implementation you're envisioning to use this API. But I'll try:

I wonder if the level of abstraction is right. The patch assumes that 
the on-disk storage of all sequences is the same, so the access method 
can't change that. But then it leaves the details of actually updating 
the on-disk block, WAL-logging and all, as the responsibility of the 
access method. Surely that's going to look identical in all the seqams, 
if they all use the same on-disk format. That also means that the 
sequence access methods can't be implemented as plugins, as plugins 
can't do WAL-logging.

The comment in seqam.c says that there's a private column reserved for 
access method-specific data, called am_data, but that seems to be the 
only mention of am_data in the patch.

- Heikki



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: pre-commit triggers
Next
From: Heikki Linnakangas
Date:
Subject: Re: trivial one-off memory leak in guc-file.l ParseConfigFile