Re: Lock strategies!

From: Jeff <threshar(at)torgo(dot)978(dot)org>
To: MaRcElO PeReIrA <gandalf_mp(at)yahoo(dot)com(dot)br>
Cc: pg(at)fastcrypt(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Lock strategies!
Date: 2003-11-24 16:27:24
Message-ID: 20031124112724.53cda3e7.threshar@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 24 Nov 2003 12:48:26 -0300 (ART)
MaRcElO PeReIrA <gandalf_mp(at)yahoo(dot)com(dot)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(at)jefftrout(dot)com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2003-11-24 16:43:14 Re: updated linux startup script?
Previous Message MaRCeLO PeReiRA 2003-11-24 16:18:46 Re: Lock strategies!