SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard Pedro Monteiro's Avatar
    Join Date
    Sep 2002
    Location
    Lisbon
    Posts
    1,393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Should I keep this data in its own table?

    My website is keeping track of user data such as number of forum posts this month, number of yearly, number of user registrations etc...
    I can naturally get this information by making a query to the forum posts table, to the users table etc... but is there any benefit of storing all of this information in an independent table just for stats?

    Lets me explain a bit better, when the user logins his backoffice, he will be presented with a dashboard with an overview of his user stats. Instead of making separate queries to each table (ex. users, forum posts, etc..) wouldn't it be simpler to store this info in a table that is updated (ex. twice a day)?

    Regards

  2. #2
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you have so many records in your database that the query is too slow. You could run a cron job that populated a stats table. Otherwise its redundant.

  3. #3
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah with that you can manage all your slow speed...

  4. #4
    SitePoint Wizard Pedro Monteiro's Avatar
    Join Date
    Sep 2002
    Location
    Lisbon
    Posts
    1,393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks eruna.
    But one question, technically queries 2 separate tables would require more effort then querying a single table?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •