Re: Performance Implications of Using Exceptions

Поиск
Список
Период
Сортировка
От James Mansion
Тема Re: Performance Implications of Using Exceptions
Дата
Msg-id 47F3DC5A.30705@mansionfamily.plus.com
обсуждение исходный текст
Ответ на Re: Performance Implications of Using Exceptions  ("Stephen Denne" <Stephen.Denne@datamail.co.nz>)
Список 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 по дате отправления:

Предыдущее
От: James Mansion
Дата:
Сообщение: Re: POSIX file updates
Следующее
От: Andreas Kostyrka
Дата:
Сообщение: Re: POSIX file updates