MySQL Forums
Forum List  »  General

Re: Number of records in a table
Posted by: Peter Brawley
Date: January 08, 2022 10:42AM

Rowcounts in non-transactional tables (eg MyISAM) are given by ...

select count(*) from tablename;

In a transactional (ie InnoDB) table, the issue is more complicated---there may be insertions or deletions hidden in transactions which your executing client has no access to, the above query gives only an estimate, there is no such thing as a provably correct rowcount, eg see https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_stats_on_metadata

Options: ReplyQuote


Subject
Written By
Posted
Re: Number of records in a table
January 08, 2022 10:42AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.