myisamchk
— MyISAM Table-Maintenance Utility
332
•
Recordblocks
How many blocks (links) are used. For fixed-format tables, this is the same as the number of rows.
•
Deleteblocks
How many blocks (links) are deleted.
•
Recorddata
How many bytes in the data file are used.
•
Deleted data
How many bytes in the data file are deleted (unused).
•
Lost space
If a row is updated to a shorter length, some space is lost. This is the sum of all such losses, in
bytes.
•
Linkdata
When the dynamic table format is used, row fragments are linked with pointers (4 to 7 bytes each).
Linkdata
is the sum of the amount of storage used by all such pointers.
4.6.3.6.
myisamchk
Memory Usage
Memory allocation is important when you run
myisamchk
.
myisamchk
uses no more memory than
its memory-related variables are set to. If you are going to use
myisamchk
on very large tables, you
should first decide how much memory you want it to use. The default is to use only about 3MB to
perform repairs. By using larger values, you can get
myisamchk
to operate faster. For example, if you
have more than 512MB RAM available, you could use options such as these (in addition to any other
options you might specify):
shell>
myisamchk --sort_buffer_size=256M \
--key_buffer_size=512M \
--read_buffer_size=64M \
--write_buffer_size=64M ...
Using
--sort_buffer_size=16M
is probably enough for most cases.
Be aware that
myisamchk
uses temporary files in
TMPDIR
. If
TMPDIR
points to a memory file
system, out of memory errors can easily occur. If this happens, run
myisamchk
with the
--
tmpdir=path
[325]
option to specify a directory located on a file system that has more space.
When performing repair operations,
myisamchk
also needs a lot of disk space:
• Twice the size of the data file (the original file and a copy). This space is not needed if you do a
repair with
--quick
[324]
; in this case, only the index file is re-created. This space must be
available on the same file system as the original data file, as the copy is created in the same
directory as the original.
• Space for the new index file that replaces the old one. The old index file is truncated at the start of
the repair operation, so you usually ignore this space. This space must be available on the same file
system as the original data file.
• When using
--recover
[324]
or
--sort-recover
[325]
(but not when using
--safe-
recover
[324]
), you need space on disk for sorting. This space is allocated in the temporary
directory (specified by
TMPDIR
or
--tmpdir=path
[325]
). The following formula yields the amount
of space required:
(
largest_key
+
row_pointer_length
) *
number_of_rows
* 2
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 ...