database - mysql aggregate vs store - micropayments forum -


i launched world's first micropayments forum... rudebagel. explaining friend how on user's profile page (ie "bob") possible see posts bob had valued sorted valued least valued. that's when realized table (user_values) in mysql db stores each transaction... results might this...

  1. "my awesome sunset" - $0.25 cents
  2. "my awesome sunset" - $0.25 cents
  3. "my awesome sunset" - $0.25 cents
  4. "momentous monkey" - $0.10 cents
  5. "momentous monkey" - $0.10 cents

bob clicked quarter button 3 times sunset , dime button twice monkey. i'd have aggregate data.

i'm not database expert... , anxiety of complex aggregated/joined tables tempts me create table gets updated whenever transaction made. use table sorting value , other table (user_values) displaying recent activity.

here's page contains code when coin button clicked...

ajax_value.php

my economics better programming.

so should create table store aggregated info or should aggregate user_values table every time info requested? if aggregating way go... what's query? in advance!


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -