Re: Lock strategies! - Mailing list pgsql-general

From Jeff
Subject Re: Lock strategies!
Date
Msg-id 20031124112724.53cda3e7.threshar@torgo.978.org
Whole thread Raw
In response to Re: Lock strategies!  (MaRcElO PeReIrA <gandalf_mp@yahoo.com.br>)
List pgsql-general
On Mon, 24 Nov 2003 12:48:26 -0300 (ART)
MaRcElO PeReIrA <gandalf_mp@yahoo.com.br> wrote:

> The biggest problem it that I *can't* have holes in
> that column, so it was because I used id (serial) and
> forn_id (integer).
>

Well, if you cannot use a sequence you will have no choice but to use
locking.

don't use max - it isn't fast on PG use select forn_id from thetable
order by fornid desc limit 1. You'll need an index on forn_id or
performance will suffer.

--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

pgsql-general by date:

Previous
From: MaRCeLO PeReiRA
Date:
Subject: Re: Lock strategies!
Next
From: Lamar Owen
Date:
Subject: Re: updated linux startup script?