Re: Sequence Access Method WIP

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Sequence Access Method WIP
Date: 2013-11-15 18:08:30
Message-ID: 5286631E.1000406@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14.11.2013 22:10, Simon Riggs wrote:
> On 16 January 2013 00:40, Simon Riggs <simon(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-11-15 18:20:10 Re: trivial one-off memory leak in guc-file.l ParseConfigFile
Previous Message Andrew Dunstan 2013-11-15 18:01:48 pre-commit triggers