Bug #110108 | DATA_FREE from information_schema.tables is inaccurate | ||
---|---|---|---|
Submitted: | 17 Feb 2023 12:17 | Modified: | 2 Jun 2023 5:30 |
Reporter: | Huaxiong Song (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Information schema | Severity: | S3 (Non-critical) |
Version: | 5.7.40, 5.7.42 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[17 Feb 2023 12:17]
Huaxiong Song
[17 Feb 2023 13:36]
MySQL Verification Team
Hi Mr. Song, Thank you for your bug report. We have repeated your test case and got the following result: SELECT DATA_FREE, TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ORDER BY DATA_FREE DESC LIMIT 10; DATA_FREE TABLE_SCHEMA TABLE_NAME 4194304 sbtest sbtest1 3145728 mysql innodb_table_stats 3145728 mysql innodb_index_stats 3145728 mysql password_history 3145728 mysql role_edges 3145728 mysql plugin 3145728 mysql default_roles 3145728 mysql func 3145728 mysql global_grants 3145728 mysql user SELECT DATA_FREE, FILE_NAME, ENGINE FROM INFORMATION_SCHEMA.FILES WHERE TABLESPACE_NAME='innodb_temporary'; DATA_FREE FILE_NAME ENGINE 6291456 ./ibtmp1 InnoDB You wanted free space in the tablespace "innodb_temporary". You have got that value. So, we have got what we asked for. We do not see what is confusing in that ......
[17 Feb 2023 16:24]
Huaxiong Song
Hi, I just build and tried again with mysql-server 5.7.41(Tag:mysql-5.7.41). And I got the same result. In the result you provided, the database is mysql, but 5.7 should be information_schema (although it is a view).Is the version correct? What I mean is that the temporary table (InnoDB engine) in i_s share DATA_FREE of innodb_temporary. But for non-innodb engine tables in I_S, the value is 0(found by limit 20). ========result in 5.7.41=========== SELECT DATA_FREE, TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ORDER BY DATA_FREE DESC LIMIT 20; DATA_FREE TABLE_SCHEMA TABLE_NAME 75497472 information_schema COLUMNS 75497472 information_schema EVENTS 75497472 information_schema OPTIMIZER_TRACE 75497472 information_schema PARAMETERS 75497472 information_schema PARTITIONS 75497472 information_schema PLUGINS 75497472 information_schema PROCESSLIST 75497472 information_schema ROUTINES 75497472 information_schema TRIGGERS 75497472 information_schema VIEWS 4194304 sbtest sbtest1 84 mysql user 0 information_schema CHARACTER_SETS 0 information_schema COLLATIONS 0 information_schema COLLATION_CHARACTER_SET_APPLICABILITY 0 information_schema COLUMN_PRIVILEGES 0 information_schema ENGINES 0 information_schema FILES 0 information_schema GLOBAL_STATUS 0 information_schema GLOBAL_VARIABLES By the way, 8.0 mtr got the similar result like you. ======result in 8.0======== SELECT DATA_FREE, TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ORDER BY DATA_FREE DESC LIMIT 10; DATA_FREE TABLE_SCHEMA TABLE_NAME 7340032 mysql innodb_table_stats 7340032 mysql innodb_index_stats 7340032 mysql password_history 7340032 mysql role_edges 7340032 mysql plugin 7340032 mysql default_roles 7340032 mysql func 7340032 mysql global_grants 7340032 mysql user 7340032 mysql db SELECT DATA_FREE, FILE_NAME, ENGINE FROM INFORMATION_SCHEMA.FILES WHERE TABLESPACE_NAME='innodb_temporary'; DATA_FREE FILE_NAME ENGINE 6291456 ./ibtmp1 InnoDB In 8.0 DATA_FREE is from database "mysql", I think it is OK. However,in 5.7, DATA_FREE is from I_S and the tables are view, not base table.
[21 Feb 2023 12:32]
Huaxiong Song
as above
[1 Jun 2023 10:35]
MySQL Verification Team
Thank you Huaxiong for the feedback. I'll get back to you if anything further needed on this. Sincerely, Umesh
[2 Jun 2023 5:30]
MySQL Verification Team
Hello Huaxiong, Thank you for the feedback. Verified as described. regards, Umesh