myisamchk supports the following options for actions other than table checks and repairs:myisamchk支持除表检查和修复之外的以下操作选项:
--analyze
, -a
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
statement.tbl_name
myisamchk --description --verbose tbl_name
命令或SHOW INDEX FROM tbl_name
语句。
--block-search=
, offset
-b
offset
Find the record that a block at the given offset belongs to.找到给定偏移量的块所属的记录。
--description
, -d
Print some descriptive information about the table. Specifying the 打印一些关于表格的描述性信息。指定--verbose
option once or twice produces additional information. --verbose
选项一两次会产生其他信息。See Section 4.6.4.5, “Obtaining Table Information with myisamchk”.请参阅第4.6.4.5节,“使用myisamchk获取表格信息”。
--set-auto-increment[=
, value
]-A[
value
]
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). AUTO_INCREMENT
编号从给定值开始(或更高,如果现有记录的AUTO_INCREMENT
值如此之大)。If value
is not specified, AUTO_INCREMENT
numbers for new records begin with the largest value currently in the table, plus one.
--sort-index
, -S
Sort the index tree blocks in high-low order. This optimizes seeks and makes table scans that use indexes faster.按高低顺序对索引树块进行排序。这优化了查找,并使使用索引的表扫描更快。
--sort-records=
, N
-R
N
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. SELECT
和ORDER BY
操作。(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.SHOW INDEX
,它以myisamchk看到的顺序显示表的索引。索引从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. PACK_KEYS=0
),它们的长度相同,因此当myisamchk排序和移动记录时,它只会覆盖索引中的记录偏移量。If keys are packed (如果键被打包(PACK_KEYS=1
), myisamchk must unpack key blocks first, then re-create indexes and pack the key blocks again. PACK_KEYS=1
),myisamchk必须首先解包键块,然后重新创建索引并再次打包键块。(In this case, re-creating indexes is faster than updating offsets for each index.)(在这种情况下,重新创建索引比更新每个索引的偏移量更快。)