0

What is the Big-O (O(?)) for counting the number of rows in a MySQL table?

SELECT COUNT(*) rows FROM myTable

I could not find this information in the documentation, but in this case, I am assuming that there is no WHERE or GROUP BY.

user207421
  • 298,294
  • 41
  • 291
  • 462
space_food_
  • 675
  • 1
  • 4
  • 21
  • If you're asking if there is some place in a MySQL database that contains an up-to-date row counts for all tables, then the answer is no. Otherwise, the answer is trivial. – mustaccio Feb 06 '17 at 18:47

1 Answers1

1

This is a duplicate of MySQL - Complexity of: SELECT COUNT(*) FROM MyTable;.

For those curious on what "big-O" means, it refers to the time complexity of a computational operation.

Community
  • 1
  • 1