Re: Performance Implications of Using Exceptions - Mailing list pgsql-performance

From James Mansion
Subject Re: Performance Implications of Using Exceptions
Date
Msg-id 47F3DC5A.30705@mansionfamily.plus.com
Whole thread Raw
In response to Re: Performance Implications of Using Exceptions  ("Stephen Denne" <Stephen.Denne@datamail.co.nz>)
List pgsql-performance
Stephen Denne wrote:
> A third option is to update, if not found, insert.
>
>
I find myself having to do this in Sybase, but it sucks because there's
a race - if there's no row updated then there's no lock and you race
another thread doing the same thing. So you grab a row lock on a
sacrificial row used as a mutex, or just a table lock. Or you just
accept that sometimes you have to detect the insert fail and retry the
whole transaction. Which is sucky however you look at it.

I think the 'update or insert' or 'merge' extensions make a degree
of sense. At least in psql one can use the lightweight lock manager.



pgsql-performance by date:

Previous
From: James Mansion
Date:
Subject: Re: POSIX file updates
Next
From: Andreas Kostyrka
Date:
Subject: Re: POSIX file updates