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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:35:57+00:00 2026-06-18T14:35:57+00:00

Well, this should be enough to get number of all records in current database:

  • 0

Well, this should be enough to get number of all records in current database:

SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_SCHEMA = DATABASE();

Surprisingly, I’m getting different numbers each time I execute above statement! First I thought there is a problem with my database. But it’s same for sample db provided by MySQL developers.

Executing above statement on the sakila multiple times results in this values:

46362
48104
45170
47060
48139

What I’m doing wrong? Is this a bug?

  • 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-18T14:35:59+00:00Added an answer on June 18, 2026 at 2:35 pm

    This is an InnoDB thing – you can instead count(id) on the table, but it’s slow.

    Because it’s slow, InnoDB takes a random sample of rows, measures the sizes, then divides the total size to determine approx how many rows there are.

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

Sidebar

Related Questions

well this is my problem i use 2 source first query (select * from
Well this should've been simple enough. I modified the project's web.xml in order to
I hope I can explain this well enough so that you can understand the
Edit: All fixed now. Beginners mistake but I thought I had troubleshot well enough
Hopefully I can articulate my question well enough to get some clear and usable
HI, This should be easy but I don't understand enough about how grouping works.
This should be simple enough, and I blame this primarily on my inexperience working
Well this is weird let me describe the scenario I have this mailer define
Well this file was put in the repo by mistake and was deleted and
Well this is a really weird issue, I really didn't find anything on this

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.