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 6886727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:47:45+00:00 2026-05-27T05:47:45+00:00

I’ve got a table which keeps track of article views. It has the following

  • 0

I’ve got a table which keeps track of article views. It has the following columns:

id, article_id, day, month, year, views_count.

Let’s say I want to keep track of daily views / each day for every article. If I have 1,000 user written articles. The number of rows would compute to:

365 (1 year) * 1,000 => 365,000

Which is not too bad. But let say. The number of articles grow to 1M. And as time passes by to 3 years. The number of rows would compute to:

365 * 3 * 1,000,000 => 1,095,000,000

Obviously, over time, this table will keep growing. And quite fast. What problems will this cause? Or should I not worry since RDBM’s handle situations like this quite commonly?

I plan on using the views data in our reports. Either break it down to months or even years. Should I worry about 1B+ rows in a table?

  • 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-27T05:47:46+00:00Added an answer on May 27, 2026 at 5:47 am

    The question to ask yourself (or your stakeholders) is: do you really need 1-day resolution on older data?

    Have a look into how products like MRTG, via RRD, do their logging. The theory is you don’t store all the data at maximum resolution indefinitely, but regularly aggregate them into larger and larger summaries.

    That allows you to have 1-second resolution for perhaps the last 5-minutes, then 5-minute averages for the last hour, then hourly for a day, daily for a month, and so on.

    So, for example, if you have a bunch of records like this for a single article:

    year | month | day | count | type
    -----+-------+-----+-------|------
    2011 |    12 |   1 |     5 | day
    2011 |    12 |   2 |     7 | day
    2011 |    12 |   3 |    10 | day
    2011 |    12 |   4 |    50 | day
    

    You would then at regular periods create a new record(s) that summarises these data, in this example just the total count for the month

    year | month | day | count | type
    -----+-------+-----+-------|------
    2011 |    12 |   0 |    72 | month
    

    Or the average per day:

    year | month | day | count | type
    -----+-------+-----+-------+------
    2011 |    12 |   0 |   2.3 | month
    

    Of course you may need some flag to indicate the “summarised” status of the data, in this case I’ve used a ‘type’ column for finding the “raw” records and the processed records, allowing you to purge out the day records as required.

    INSERT INTO statistics (article_id, year, month, day, count, type)
    SELECT article_id, year, month, max(day), sum(count), 'month'
    FROM statistics
    WHERE type = 'day'
    GROUP BY article_id, year, month, type
    

    (I haven’t tested that query, it’s just an example)

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

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.