Re: question on most efficient way to increment a column

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: question on most efficient way to increment a column
Дата
Msg-id CAHyXU0zK1KFE=XOOtnihrtE9BsAqfx6Ai0XGpLKVQUZe6QtNzQ@mail.gmail.com
обсуждение исходный текст
Ответ на question on most efficient way to increment a column  (Tyson Maly <tvmaly@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Tyson Maly
Дата:
Сообщение: question on most efficient way to increment a column
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: question on most efficient way to increment a column