myisamchk
— MyISAM Table-Maintenance Utility
322
key_buffer_size
is used when you are checking the table with
--extend-check
[323]
or when
the keys are repaired by inserting keys row by row into the table (like when doing normal inserts).
Repairing through the key buffer is used in the following cases:
• You use
--safe-recover
[324]
.
• The temporary files needed to sort the keys would be more than twice as big as when creating the
key file directly. This is often the case when you have large key values for
CHAR
,
VARCHAR
, or
TEXT
columns, because the sort operation needs to store the complete key values as it proceeds. If you
have lots of temporary space and you can force
myisamchk
to repair by sorting, you can use the
--
sort-recover
[325]
option.
Repairing through the key buffer takes much less disk space than using sorting, but is also much
slower.
If you want a faster repair, set the
key_buffer_size
and
sort_buffer_size
variables to about
25% of your available memory. You can set both variables to large values, because only one of them is
used at a time.
myisam_block_size
is the size used for index blocks.
stats_method
influences how
NULL
values are treated for index statistics collection when the
--analyze
[325]
option is given. It acts like the
myisam_stats_method
system variable. For
more information, see the description of
myisam_stats_method
in
Section 5.1.4, “Server System
Variables”
, and
Section 8.5.4, “
MyISAM
Index Statistics Collection”
. For MySQL 5.0,
stats_method
was added in MySQL 5.0.14. For older versions, the statistics collection method is equivalent to
nulls_equal
.
ft_min_word_len
and
ft_max_word_len
indicate the minimum and maximum word length for
FULLTEXT
indexes.
ft_stopword_file
names the stopword file. These need to be set under the
following circumstances.
If you use
myisamchk
to perform an operation that modifies table indexes (such as repair or analyze),
the
FULLTEXT
indexes are rebuilt using the default full-text parameter values for minimum and
maximum word length and the stopword file unless you specify otherwise. This can result in queries
failing.
The problem occurs because these parameters are known only by the server. They are not stored in
MyISAM
index files. To avoid the problem if you have modified the minimum or maximum word length
or the stopword file in the server, specify the same
ft_min_word_len
,
ft_max_word_len
, and
ft_stopword_file
values to
myisamchk
that you use for
mysqld
. For example, if you have set the
minimum word length to 3, you can repair a table with
myisamchk
like this:
shell>
myisamchk --recover --ft_min_word_len=3 tbl_name.MYI
To ensure that
myisamchk
and the server use the same values for full-text parameters, you can place
each one in both the
[mysqld]
and
[myisamchk]
sections of an option file:
[mysqld]
ft_min_word_len=3
[myisamchk]
ft_min_word_len=3
An alternative to using
myisamchk
is to use the
REPAIR TABLE
,
ANALYZE TABLE
,
OPTIMIZE
TABLE
, or
ALTER TABLE
. These statements are performed by the server, which knows the proper full-
text parameter values to use.
4.6.3.2.
myisamchk
Check Options
myisamchk
supports the following options for table checking operations:
•
--check
[322]
,
-c
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...