Re: sequence skips 30 values, how?

From: Jorge Godoy <jgodoy(at)gmail(dot)com>
To: "Angva" <angvaw(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: sequence skips 30 values, how?
Date: 2007-02-01 13:34:03
Message-ID: 877iv2ngs4.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Angva" <angvaw(at)gmail(dot)com> writes:

> As others have said, sequences can have gaps. In fact, the thought of
> a gap-free sequence is scary to me. Unless you do very few inserts,
> "gap-free sequence" is pretty much synonymous with "not scalable". If
> your goal is to generate a unique number for each row (which is
> usually the case), then gaps should be fine.
>
> Though I must admit I have occasionally wished for sequences with a
> GAPFREE option...For small, static look-up tables that I update once
> in a blue moon. It's just easier on the eyes to have 1,2,3,4,5 than 1,
> 25, 2405, 95720, 59028598253.

There's a recipe for gapless sequences on Varlena (if you can access it from
your end...) that was the result of discussions here. There's a performance
hit, of course, but it works.

--
Jorge Godoy <jgodoy(at)gmail(dot)com>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2007-02-01 14:19:57 Re: How can I list the function.
Previous Message Alban Hertroys 2007-02-01 12:41:08 Re: PG Email Client