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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章