Re: Equivalent for AUTOINCREMENT?

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Michelle Konzack <linux4michelle(at)tamay-dogan(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Equivalent for AUTOINCREMENT?
Date: 2008-11-07 12:46:01
Message-ID: 49143889.2080609@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michelle Konzack wrote:
> Halle Craig,
>
> Am 2008-11-05 20:37:31, schrieb Craig Ringer:
>> If you really, truly need gapless sequences, there are some options. I
>> posted about them recently on another thread. The archives will contain
>> that post and many others from many people on the same topic. Be aware,
>> though, that gapless sequences have some NASTY performance consequences.
>
> Since this "NASTY performance consequences" would only hit the INSERT
> statement and it is very unlikely that I have concurence WRITE/INSERT
> access, it is a minor problem.

And DELETE.

And anything that happens in the same transaction after the INSERT or
DELETE that touches the table with the gapless sequence.

It'll probably be OK if you keep the transactions that modify the table
with the gapless sequences as short as possible, preferably doing
nothing except the modification in question.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2008-11-07 12:49:01 avoiding seq scan without duplicating
Previous Message Craig Ringer 2008-11-07 12:43:14 Re: Equivalent for AUTOINCREMENT?