Sysadmin here (not a developer by trade), so go easy please ;)
I have a mysql table, on a linux server that uses
When I try to do
select count(foo) from table; It doesn't finish. I gave it a good 5 minutes before interrupting.
table.ibd file is about 43G (45176848384). Since the count() seemed like it was never going to finish, I decided to try the following to get an estimate of the row count:
I dumped the first 10,000 rows of the table and imported it to a local database that also has
innodb_file_per_table and I hope all else equal.
That file, after I imported it, (with only 10,000 rows) is about 2M (2097152)
45176848384/2097152 21542 21542*10000 215420000
Then, is it correct to assume that the ~43G table is around 215 million rows? Are there other considerations I'm overlooking?
Or is there a better way for me to determine how many rows are in this table?