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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:16:27+00:00 2026-06-07T23:16:27+00:00

I have a MySQL table to store user statistics with >2MM rows and 8

  • 0

I have a MySQL table to store user statistics with >2MM rows and 8 columns and an index on the userID. When the user visits his profile a lot of those informations are retrieved from the database resulting in – worst case – a couple of dozen SELECT queries sometimes joined with other tables. It is similar to the profile on SO which has to pull a lot of data as well.

Some queries like to get the user score require a COUNT and other performance eating MySQL functions. So just the queries for the profile page can take up to 10-20 seconds.

Now my questions:

  1. How does a website like SO pull so many informations that quickly?
  2. Do I need a caching layer?
  3. Should I precalculate the count of
    the score, etc. that consume MySQL performance?
  4. Should I use one
    writing optimized table and one reading optimized table? If so how
    could I retrieve live data like on SO?
  5. Should I move away from MySQL?
  • 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-06-07T23:16:30+00:00Added an answer on June 7, 2026 at 11:16 pm

    How does a website like SO pull so many informations that quickly?

    They give you an illusion of pulling “so much” data, but in reality they get one chunk at a time. Basically, you would need one query to get the COUNT of the results, and another query to get the data for any page within that resultset. The result set is not cached. The parameters to the query may be cached. But it is best to implement in a way the query parameters are supplied with every page request.

    Do I need a caching layer?

    May be. But not necessary to implement this. Caching may be useful to store the previously fetched pages, and the same pages are used by entire community, rather than one user.

    Should I precalculate the count of the score, etc. that consume MySQL performance?

    Not relevant for this use case.

    Should I use one writing optimized table and one reading optimized table? If so how could I retrieve live data like on SO?

    Not required.

    Should I move away from MySQL?

    Not required.

    For more details on this concept, lookup paginated Ajax grids

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

Sidebar

Related Questions

I have a BirthDate column in MySQL database table to store user's date of
I have a MYSQL-Table which stores scores. Every time a user improves a new
I have three columns in mysql table: tax_id, company_name, store_name. I need that tax_id
I have a MySQL database where the table was set up to store the
I have a MySql table called reviews which stores a lot of product reviews,
I have a mysql database table to store country name and currency symbol -
I have a MySQL DB in which I store data about each user. I
I have a table in my database to store user data. I found a
I have a list of items in a MySQL table. The user is able
I have a MySQL table as follow: id, user, culprit, reason, status, ts_register, ts_update

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.