Search Postgresql Archives

Week numbers and calculating weekly statistics/diagrams

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

 



Hello,

I have multiplayer card game in Flash/Perl/C and would
like to add weekly tournaments/player ratings to it.

This means I have to add a table which holds:
player id, weekly score (which I update after each round)
and the week number.

Does anybody has an advice how to save the week number?

If I save it as a timestamp then calculating realtime statistics
(on a player profile click) will probably be CPU-intensive,
because I have to calculate the week numbers each time.

If I save it as string "2010/52" then it's difficult to show
statistics for a period of time (like for the last 12 months)
if there is a new year inbetween.

Maybe there is a better way?

I'm using postgresql-server-8.3.6 and OpenBSD 4.5

Regards
Alex

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

[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