How would you store read/unread topic status?

Поиск
Список
Период
Сортировка
От Mathieu Nebra
Тема How would you store read/unread topic status?
Дата
Msg-id 4A40B8A7.2090902@siteduzero.com
обсуждение исходный текст
Ответы Re: How would you store read/unread topic status?  (Andres Freund <andres@anarazel.de>)
Re: How would you store read/unread topic status?  (Alexander Staubo <alex@bengler.no>)
Re: How would you store read/unread topic status?  (justin <justin@emproshunts.com>)
Re: How would you store read/unread topic status?  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Re: How would you store read/unread topic status?  (Scott Carey <scott@richrelevance.com>)
Re: How would you store read/unread topic status?  (Alexander Staubo <alex@bengler.no>)
Список pgsql-performance
Hi all,

I'm running a quite large website which has its own forums. They are
currently heavily used and I'm getting performance issues. Most of them
are due to repeated UPDATE queries on a "flags" table.

This "flags" table has more or less the following fields:

UserID - TopicID - LastReadAnswerID

The flags table keeps track of every topic a member has visited and
remembers the last answer which was posted at this moment. It allows the
user to come back a few days after and immediately jump to the last
answer he has not read.

My problem is that everytime a user READS a topic, it UPDATES this flags
table to remember he has read it. This leads to multiple updates at the
same time on the same table, and an update can take a few seconds. This
is not acceptable for my users.

Question: what is the general rule of thumb here? How would you store
this information?

Thanks a lot in advance.
Mathieu.

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

Предыдущее
От: Laurent Laborde
Дата:
Сообщение: Re: same query in high number of times
Следующее
От: Andres Freund
Дата:
Сообщение: Re: How would you store read/unread topic status?