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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:01:04+00:00 2026-05-27T22:01:04+00:00

I’m painfully aware there probably isn’t a magic bullet to this, but it’s becoming

  • 0

I’m painfully aware there probably isn’t a magic bullet to this, but it’s becoming a problem. Each user has hundreds of thousands of rows of metrics data across 3 tables, this is updated on a second by second basis.

When a user logs in, I want to quickly deliver them top line stats for a number of their assets (i.e. alongside each asset in navi they have top level stats).

I’ve tried a number of ideas; but please – if someone has some advice or experience in this area it’d be great. Stuff tried or looked into so far:-

  • Produce static versions of top line stats every hour or so – This is intensive across all users and all assets. So how this can be done regularly, I’m not sure.
  • Call stats via AJAX, so they can be processed and fill in (getting top level stats right now can take up to 10 seconds for a larger user) once page has loaded. This could also cache stats in session to save redoing queries each page load.
  • Query run at 30 min intervals, i.e. you log on, it’ll query and then it’ll hopefully use query cache every time it’s loaded (only 1/2 seconds) until the next 30min interval.

The first one seems to have most legs, but I’m not sure how to do this, given only a small number of users will be needing those stats – it seems awfully expensive to do it for everyone all the time.

  • 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-27T22:01:05+00:00Added an answer on May 27, 2026 at 10:01 pm
    1. Produce static versions of top line stats every hour or so – This is
      intensive across all users and all assets. So how this can be done
      regularly, I’m not sure.
    2. Call stats via AJAX, so they can be processed and fill in (getting
      top level stats right now can take up to 10 seconds for a larger
      user) once page has loaded. This could also cache stats in session to
      save redoing queries each page load.
    3. Query run at 30 min intervals, i.e. you log on, it’ll query and then
      it’ll hopefully use query cache every time it’s loaded (only 1/2
      seconds) until the next 30min interval.

    Your option 1 and 3 in mySQL is known as a materialized view MySQL doesn’t currently support them but the concept can be completed link provides examples

    hundreds of thousands of records isn’t that much. good indexes and the use of analytic queries will get you quite far. Sadly this concept isn’t implemented in full but there are workarounds as well as indicated in the link provided.

    It really depends on top line stats. are you wanting real time data down to the second or are 10-20 or even 30 minute intervals acceptable? Using event scheduler one can schedule the creation/update of reporting table(s) which contain summarized data faster to query. This data then is available at fractions of seconds delivery time as all the heavy lifting has already been completed. Your focus can then be on indexing these tables to improve performance without worrying about impacts to production tables.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want to count how many characters a certain string has in PHP, but
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
I need to clean up various Word 'smart' characters in user input, including 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
For some reason, after submitting a string like this Jack’s Spindle from a text
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.