Re: question on most efficient way to increment a column - Mailing list pgsql-general

From Merlin Moncure
Subject Re: question on most efficient way to increment a column
Date
Msg-id CAHyXU0zK1KFE=XOOtnihrtE9BsAqfx6Ai0XGpLKVQUZe6QtNzQ@mail.gmail.com
Whole thread Raw
In response to question on most efficient way to increment a column  (Tyson Maly <tvmaly@yahoo.com>)
List pgsql-general
On Wed, May 8, 2013 at 8:45 AM, Tyson Maly <tvmaly@yahoo.com> wrote:
> If I have a simple table with an id as a primary key that is a serial column
> and a column to keep track of a total_count for a particular id, what method
> would provide the fastest way to increment the total_count in the shortest
> amount of time and minimize any locking?
>
> id  serial
> total_count integer
>


uh,
update foo set total_count = total_count + 1 where id = x;
?

merlin


pgsql-general by date:

Previous
From: Tyson Maly
Date:
Subject: question on most efficient way to increment a column
Next
From: Albe Laurenz
Date:
Subject: Re: question on most efficient way to increment a column