CHECKSUM TABLE 语法(翻译自mysql官方文档)

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值也可能修改。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值