Re: select/update performance? - Mailing list pgsql-general

From Rob Fielding
Subject Re: select/update performance?
Date
Msg-id 3FA8D4F2.7080600@dsvr.net
Whole thread Raw
In response to Re: select/update performance?  (Bjørn T Johansen <btj@havleik.no>)
Responses Re: select/update performance?
List pgsql-general
Bjørn T Johansen wrote:
> Yes, but the table in question have 3 PK and only one that needs this
> "sequence" so I just thought instead of getting holes in the IDs I just
> manually handle this counter somehow.. Not a big deal but... :)

You'd only get holes if you keep making nextval requests without using
the value - say by issuing rollback. The problem with holes is actually
the feature of uniqueness SEQUENCES provides. Perhaps you judge that
there is too high a chance of rollback to create a sufficient number of
holes to warrant not using a SEQUENCE.

It's all down to your application and specific situation I guess however
your counter table idea sounds exactly like what SEQUENCE provides,
without any of the guarantees.

I think I'd still recommend using a SEQUENCE for anything but the most
profound reason :)

--

Rob Fielding
rob@dsvr.net    Development     Designer Servers Ltd


pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: question
Next
From: Bjørn T Johansen
Date:
Subject: Re: select/update performance?