Re: How would you store read/unread topic status?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: How would you store read/unread topic status?
Дата
Msg-id 407d949e0906231648x7b1bb17ft3a537082b4dc4cb@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How would you store read/unread topic status?  (Mathieu Nebra <mateo21@siteduzero.com>)
Список pgsql-performance
On Tue, Jun 23, 2009 at 9:04 PM, Mathieu Nebra<mateo21@siteduzero.com> wrote:
> We have indexes on them, so we can SELECT every topic WHERE the user has
> written. Is it the good way of doing this?

I'm kind of skeptical that a simple index on userid,topic isn't
sufficient to handle this case. But you would have to test it on
actual data to be sure. It depends whether you have enough topics and
enough userid,topic records for a given userid that scanning all the
topics for a given user is actually too slow.

Even if it's necessary you might consider having a "partial" index on
user,topic WHERE writtenstatus instead of having a three-column index.

--
greg
http://mit.edu/~gsstark/resume.pdf

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

Предыдущее
От: Alan McKay
Дата:
Сообщение: SOLVED: processor running queue - general rule of thumb?
Следующее
От: Chris St Denis
Дата:
Сообщение: Re: How would you store read/unread topic status?