MySQueaL Resources

resources for mysql admins and developers who are squealing for help

More Resources

Main Doc Pages
Comments
MySQL columns: everywhere I look are tables and columns; life is filled with databases of information to be ordered and grouped. (Ca'Grande, Milan, Italy)

CHECKSUM TABLE Statement

This MySQL statement returns a MyISAM table's live checksum value, a value that can be optionally maintained to improve a table's repairability.

hits past month: 19 ;  last updated: may 4, 2009 - 2:34am ;  parent: MySQL Table & Server Administration Statements

Syntax

CHECKSUM TABLE table[,  . . . ] [QUICK|EXTENDED]

Explanation

This MySQL statement returns a MyISAM table's live checksum value, a value that can be optionally maintained to improve a MySQL table's repairability. To enable live checksum for a MySQL table, use the MySQL statement, CREATE TABLE or ALTER TABLE with a table option of CHECKSUM=1.

Multiple MySQL tables may be given in a comma-separated list. If the QUICK option is employed, the live table checksum will be returned, if available. If not, NULL will be returned. Normally one would use the QUICK option when the table is probably fine. The EXTENDED option instructs the server to check each row. You should use this option only as a last resort. If no option is specified, the QUICK option is the default, if available. Otherwise, the EXTENDED option is the default. The checksum value can be different if the row format changes, which can happen between versions of MySQL.

Examples

Here is an example of this MySQL statement's use and its results:

CHECKSUM TABLE workreq;

+----------------------+-----------+
| Table                | Checksum  |
+----------------------+-----------+
| workrequests.workreq | 195953487 |
+----------------------+-----------+
Return to MySQL Table & Server Administration Statements page of our MySQL Documentation