CHECKSUM TABLE

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

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

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 |
+----------------------+-----------+