myisamchk — MyISAM Table-Maintenance Utility Analyze the distribution of key values. This improves join performance by enabling the join optimizer to better choose the order in which to join the tables and which indexes it should use. To obtain information about the key distribution, use a  myisamchk --description --verbose  tbl_name  command or the  SHOW INDEX FROM  tbl_name  statement. Find the record that a block at the given offset belongs to. Print some descriptive information about the table. Specifying the  --verbose  option once or twice produces additional information. See Section 4.6.4.5, “Obtaining Table Information with myisamchk” . Force  AUTO_INCREMENT  numbering for new records to start at the given value (or higher, if there are existing records with  AUTO_INCREMENT  values this large). If  value  is not specified,  AUTO_INCREMENT numbers for new records begin with the largest value currently in the table, plus one. Sort the index tree blocks in high-low order. This optimizes seeks and makes table scans that use indexes faster. Sort records according to a particular index. This makes your data much more localized and may speed up range-based  SELECT  and  ORDER BY  operations that use this index. (The first time you use this option to sort a table, it may be very slow.) To determine a table’s index numbers, use  SHOW INDEX , which displays a table’s indexes in the same order that  myisamchk  sees them. Indexes are numbered beginning with 1. If keys are not packed ( PACK_KEYS=0 ), they have the same length, so when  myisamchk  sorts and moves records, it just overwrites record offsets in the index. If keys are packed ( PACK_KEYS=1 ), myisamchk  must unpack key blocks first, then re-create indexes and pack the key blocks again. (In this case, re-creating indexes is faster than updating offsets for each index.) To obtain a description of a  MyISAM  table or statistics about it, use the commands shown here. The output from these commands is explained later in this section. Runs  myisamchk  in “describe mode”  to produce a description of your table. If you start the MySQL server with external locking disabled,  myisamchk  may report an error for a table that is updated while it runs. However, because  myisamchk  does not change the table in describe mode, there is no risk of destroying data. Adding  -v  runs  myisamchk  in verbose mode so that it produces more information about the table. Adding  -v  a second time produces even more information. 571 4.6.4.5 Obtaining Table Information with myisamchk • --block-search= offset ,  -b  offset • --description ,  -d • --set-auto-increment[= value ] ,  -A[ value ] • --sort-index ,  -S • --sort-records= N ,  -R  N • myisamchk -d  tbl_name • myisamchk -dv  tbl_name • myisamchk -eis  tbl_name