Search Postgresql Archives

Re: Switching from MySQL: ON DUPLICATE KEY UPDATE, plpgsql function

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

 





APseudoUtopia wrote:
thread, then logs out (intending to read all the other forum threads
at some point in the future when they log in again). If I used a VIEW,
it would automatically consider all those unread forum posts to be
read when the user logs out.

  
That wouldn't work. What if a user logs in, reads only one forum

You are keeping a list of all the forums a user has read,  i would not worry about making sure the table tracking user activity has duplicate key values. The select can be limited to return just on row with the highest time stamp then compare this result to figure out what forms the user has not read yet.  This eliminates one of problems but creates a problem where table tracking user activity is going bloat but in low traffic times delete the duplicate values.

A similar topic was discussed  on the performance  mailing list, where updates are hung for several seconds for a similar tracking table...
http://archives.postgresql.org/pgsql-performance/2009-06/msg00300.php

 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux