Re: sequence increment jumps?

From: Douglas McNaught <doug(at)mcnaught(dot)org>
To: lists(at)benjamindsmith(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: sequence increment jumps?
Date: 2007-01-25 19:22:11
Message-ID: 87y7nqgbdo.fsf@suzuka.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Benjamin Smith <lists(at)benjamindsmith(dot)com> writes:

> On Thursday 25 January 2007 09:53, Douglas McNaught wrote:
>> Nature of the beast.  Sequence increments aren't rolled back on
>> transaction abort (for performance and concurrency reasons), so you
>> should expect gaps.
>
> Behavior long ago noted and accounted for. But I've always wondered why this
> was so? Is there a specific reason for this behavior?

Being able to roll back a sequence increment would require locking the
sequence for the duration of the transaction, which would kill
concurrency.

-Doug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Artz 2007-01-25 19:28:38 encode, lower and 0x8a
Previous Message Jeremy Haile 2007-01-25 19:06:54 Re: Stats collector frozen?