Bug #29162 | show table status row counts for innodb include deleted but unpurged rows | ||
---|---|---|---|
Submitted: | 17 Jun 2007 17:27 | Modified: | 22 Jun 2007 21:28 |
Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S4 (Feature request) |
Version: | 5.0.44, 5.1.20 | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | innodb, purge, row count |
[17 Jun 2007 17:27]
Shane Bester
[22 Jun 2007 17:29]
MySQL Verification Team
Small testcase to show what I mean. Notice how the show table status shows decreasing rowcount each second (as innodb purges the rows). select count(*) and checksum table report 0 because the table is really empty. drop table if exists bug29162; create table bug29162(id int not null auto_increment primary key,a char(255))engine=innodb; start transaction; insert into bug29162(a) values ('a'); insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; insert into bug29162(a) select a from bug29162; commit; show table status like 'bug29162'; delete from bug29162 limit 100000000; commit; show table status like 'bug29162'; select sleep(1); show table status like 'bug29162'; select sleep(1); show table status like 'bug29162'; select sleep(1); show table status like 'bug29162'; select sleep(1); show table status like 'bug29162'; select sleep(1); show table status like 'bug29162'; select sleep(1); show table status like 'bug29162'; select sleep(1); show table status like 'bug29162'; select sleep(1);
[25 Jun 2007 13:54]
Heikki Tuuri
For the SQL optimizer, it may be better to count also the delete-marked, unpurged rows. For SHOW TABLE STATUS, it would be nice to estimate only the existing row count. Marking this as a feature request.