Received: from fallon.classyad.com (IDENT:root@classyad.com [152.160.43.1]) by hub.org (8.9.1/8.9.1) with ESMTP id MAA20747 for ; Sun, 15 Nov 1998 12:17:26 -0500 (EST) (envelope-from marc@fallon.classyad.com) Received: from localhost (IDENT:marc@localhost [127.0.0.1]) by fallon.classyad.com (8.9.0/8.9.0) with SMTP id LAA08807; Sun, 15 Nov 1998 11:04:26 -0500 Date: Sun, 15 Nov 1998 11:04:26 -0500 (EST) From: Marc Howard Zuckman To: Postgres DBA cc: M Simms , SQL Mailing List Subject: Re: [SQL] abusing an aggregate funct In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sun, 15 Nov 1998, Postgres DBA wrote: > > > On Sun, 15 Nov 1998, M Simms wrote: > > > > Unfortunately, solution using sequences is not so good unless you don't > > > suppose to use access to that table from some simultaneously running > > > sessions. The problem is that every sessions accessing this additional > > > sequence with nextval() will get its own pool of values for the > > > sequence, so early or later you'll get some gaps in records numbering > > > because of at least on of two reasons: > > > > >From the manpage of create sequence > > > > > > Low-level locking is used to enable multiple simultaneous > > calls to a generator. > > > > Doesnt this mean it will work for this task? > > > > > > Sure, you can access one sequence from a couple of sessions at once but > it the only thing is guaranteed is UNIQUENESS of values you get from > nestval() across one sequence. Although nobody can promise you that there > will no gaps... There are lots of reasons, I mentioned just some of them > (see my previous posting in this thread) > > Aleksey > > > > My understanding is that if you do not enable the cache feature of the sequence, there will be no gaps. Of course, disabling the cache slows the transaction. Marc Zuckman marc@fallon.classyad.com _\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ _ Visit The Home and Condo MarketPlace _ _ http://www.ClassyAd.com _ _ _ _ FREE basic property listings/advertisements and searches. _ _ _ _ Try our premium, yet inexpensive services for a real _ _ selling or buying edge! _ _\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_