CHECKSUM TABLE tbl_name [, tbl_name] ... [QUICK | EXTENDED]
check table is reports a table checksum
check table 命令提供了表的checksum。
this statement requires the select privilege for the table
此语句需要有表读取的权限。
this statement is not supported for views.If you checksum table against a view, the checksum value is always null, and a waring is returned.
此语句不支持视图。如果你对视图使用了checksum table,会返回null值,并且会有警告。
During the checksum operation, the table is locked with a read lock for Innodb and MyISAM.
使用checksum操作时,使用innodb和myisam引擎的表会被加上读锁。
with quick, the live table checksum is reported if it is available,or null otherwise.This is very fast。
使用quick参数,表的checksum会被提供如果checksum是可用的,否则返回null.这是非常快的。
a live checksum is enabled by specifying the checksum=1 table option when you create the table.
通过在创建表的时候指定checksum=1表的选项,活动checksum是可用的
currently, this is supported only for the MyISAM tables.the quick method is not supported with InnoDB tables.
目前,quick仅支持MyISAM的表,quick方法不支持InnoDB的表。
with extended, the entire table is read row by row and the checksum is calculated.This can be very slow with large tables
使用extended命令,整个表会逐行读取数据,并且计算checksum。如果表的数据很大就会很慢。
If neither the quick nor extended is specified, Mysql returns a live checksum if the storage engine supported it and scans the table otherwise.
如果既没有指定quick和extended命令,如果存储引擎支持,mysql会返回一个checksum,否则会扫描全表。
In Mysql5.5,checksum table return 0 for partitioned table unless includes the expended option.the issue is resolved in mysql 5.6
mysql 5.5的版本,分区表除非使用了extended选项,否则checksum会返回0,这个问题在5.6版本解决了。
The checksum value depends on the table row format.if the row format changes, the checksum is also changes.
checksum的值取决与表数据的格式,如果数据格式改变了,checksum也会改变。
for example, the storage format for temporal types such as time ,datetime,timestamp change in mysq5.6 prior to mysql5.6.5,so if a mysql 5.5 table is upgraded to mysql5.6,the checksum value may change
例如,时间类型的存储格式,time,datetime,timestamp,在mysql5.6.5之前的mysql5.6中的更改,checksum值也可能修改。