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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 23, 2009 at 9:04 PM, Mathieu Nebra<mateo21@xxxxxxxxxxxxxx> 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

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux