Re: Incr/Decr Integer

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Incr/Decr Integer
Дата
Msg-id 4A5F7577.4000306@archonet.com
обсуждение исходный текст
Ответ на Incr/Decr Integer  (William Scott Jordan <wsjordan@brownpapertickets.com>)
Список pgsql-performance
William Scott Jordan wrote:
> Hey all!
>
> Is there a better way to increase or decrease the value of an integer
> than doing something like:

> UPDATE the_table SET the_int = the_int + 1 WHERE the_id = 123 ;

No.

> We seem to be getting a lot of deadlocks using this method under heavy
> load.  Just wondering if we should be doing something different.

You can't get deadlocks with that - it only references one table.

What is the purpose of this query - how are you using it?

--
   Richard Huxton
   Archonet Ltd

В списке pgsql-performance по дате отправления:

Предыдущее
От: Scott Carey
Дата:
Сообщение: Re: cluster index on a table
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: cluster index on a table