Comments - Incredibly slow count(*) on MariaDB / MySQL
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
With InnoDB, since it only stores estimates of the number of rows in the table, in order to obtain the specific value with COUNT(*), all rows need to be read, which is very slow.
If you're happy with an estimate, you can query information_schema.tables, for example:
See also MDEV-18188.
Thank you for your comment Ian. Meaning if I'd turn this to use MyISAM it'd work faster?
I'll test it and revert with results :)
Yes, I'm aware of the estimate option via table_rows - can I control its update frequency / ratio i.e if i run ANALYZE TABLE [table_name] periodically does it update the stats?