Sub Menu
Links Menu
Online Users

In total there are 303 users online :: 3 registered, 0 hidden and 300 guests

Most users ever online was 1091 on Wed Aug 16, 2023 5:27 pm

Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot] based on users active over the past 60 minutes

Where store calculated values from several tables?

Any topics related to phpBB (non-IntegraMOD related)

Moderator: Integra Moderator

Where store calculated values from several tables?

PostAuthor: Rixn » Tue Jul 11, 2006 6:17 am

I've got a DB with highscores from several Shockwave games. Each game has its own table with the columns Score, Name and Date. In addition I've got a table with game parameters like game name, type, score type and so on.

Now I want to keep track on statistics for the games, that is values that I get from each game that I do some calculation on. Should I store those in the additional table or should I calculate them each time I need them?

Is it possible to have a script running in the back to calculate these values and then keep storing them into the table? I fear that always calculating when I need the values would slow things down so I hope one can solve this in another way.

What do you all say about this - what should I do?

Regards
/Rixn
Last edited by Rixn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[hr]Lars Eriksson
Information Designer
lars@rixn.se
[url=http]The DaGame Project[/url]
User avatar
Rixn
Members
Members
 
Posts: 44
Likes: 0 post
Liked in: 0 post
Joined: Sun May 07, 2006 5:33 am
Cash on hand: 0.00
Location: Stockholm

Re: Where store calculated values from several tables?

PostAuthor: Michaelo » Mon Jul 17, 2006 5:39 pm

My rule of thumbà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦
If you are going to store data to be retrieved only once and not use in some other process try the calculation method firstà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦ it should be faster than an sql queryà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦

The calculation should be done in the in the php file that send data to the associated tpl fileà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦

If you are doing several calculations (one for each game) then you should consider saving these to the databaseà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦

Mike
Last edited by Michaelo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Kiss Portal Engine phpbbireland (status: Released)
User avatar
Michaelo
Administrator
Administrator
 
Posts: 1646
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 5:14 pm
Cash on hand: 0.00
Location: Dublin, Ireland


Return to phpBB Related Topics

Who is online

Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot]

cron