Name

CHECKSUM TABLE

Synopsis

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

Use this statement to determine a table’s checksum value. Multiple 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. You would tend to use QUICK when the table is probably fine. To enable live checksum for a table, use the ALTER TABLE statement with a table option of CHECKSUM=1. 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. Here is an example of this statement’s use and its results:

CHECKSUM TABLE workreq;
+----------------------+-----------+
| Table                | Checksum  |
+----------------------+-----------+
| workrequests.workreq | 195953487 |
+----------------------+-----------+

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.