Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1086307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:47:49+00:00 2026-05-16T22:47:49+00:00

Simplified case: Storage Users click on a link link_clicks +1 for each click Super

  • 0

Simplified case:

Storage

  1. Users click on a link
  2. link_clicks +1 for each click
  3. Super user sets a multiplier parameter for each click
  4. link_reward (+1 * param) for each click
  5. User ID is also recorded for each click

Retrieval

  • Queries must be done on a specific date range (e.g., “How many click between Oct 10 and Oct 23 for User ID = 4”)
  • Most queries will be done, however, on the sum of all dates for a given user

Assuming the table gets massive, both kinds of queries will get very slow right?

How does one handle this? Simultaneously store in one detailed table (a row per click per user per link) and in one summary table (a row per user per link)? I’ve heard of “rolling up” the data but I don’t know what that means.

Technologies used: MySQL, PHP (and Javascript)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:47:49+00:00Added an answer on May 16, 2026 at 10:47 pm

    How does one handle this? Simultaneously store in one detailed table (a row per click per user per link) and in one summary table (a row per user per link)?

    Yes, but add a DATETIME column so you can do the period checking you mentioned in (a). Populate the DATETIME column using the NOW() function to get the current date & time. Something to mind about option (a) is that the criteria will minimize the data being summarized, so performance shouldn’t be too big of a concern. Also, the details table probably shouldn’t be indexed because indexes only help getting data out, and slow down putting data into a table.

    The super user reward should probably be a separate table, but this means that your details table needs to relate to the super user either by their userid or URL. userid would be a better choice.

    I’ve heard of “rolling up” the data but I don’t know what that means.

    A database principle is to store only what you need–summary data can be calculated using functions like SUM and COUNT. You can create a view, which can be queried like a table but it doesn’t store any data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have the following (simplified case): class Color; class IColor { public: virtual
Consider the following simplified case: lol = [['John','Polak',5,3,7,9], ['John','Polak',7,9,2,3], ['Mark','Eden' ,0,3,3,1], ['Mark','Eden' ,5,1,2,9]] What
Consider the (highly simplified) following case: class Dispatcher { public: receive() {/*implementation*/}; // callback
I got some difficulties designing my case classes. A simplified version looks like: abstract
I have a Role domain class, which I have simplified to illustrate the case
Simplified for example, I have two tables, groups and items . items ( id,
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
My simplified and contrived example is the following:- Lets say that I want to
Here's a simplified version of what I'm trying to do : Before any other
Here is a simplified version of my database model. I have two tables: Image,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.