Incr/Decr Integer

From: William Scott Jordan <wsjordan(at)brownpapertickets(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Incr/Decr Integer
Date: 2009-07-16 17:56:47
Message-ID: 4A5F69DF.4080408@brownpapertickets.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

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 ;
---

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

Thanks!

-William

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andres Freund 2009-07-16 18:30:56 Re: [PERFORM] Incr/Decr Integer
Previous Message CG 2009-07-16 17:32:07 Re: best practice transitioning from one datatype to another

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Carey 2009-07-16 18:21:46 Re: cluster index on a table
Previous Message Justin Pitts 2009-07-16 17:52:58 Re: cluster index on a table