GNU Info

Info Node: (mysql.info)myisamchk memory

(mysql.info)myisamchk memory


Next: Crash recovery Prev: myisamchk other options Up: Table maintenance
Enter node , (file) or (file)node

`myisamchk' Memory Usage
........................

Memory allocation is important when you run `myisamchk'.  `myisamchk'
uses no more memory than you specify with the `-O' options.  If you are
going to use `myisamchk' on very large files, you should first decide
how much memory you want it to use.  The default is to use only about
3M to fix things.  By using larger values, you can get `myisamchk' to
operate faster.  For example, if you have more than 32M RAM, you could
use options such as these (in addition to any other options you might
specify):

     shell> myisamchk -O sort=16M -O key=16M -O read=1M -O write=1M ...

Using `-O sort=16M' should probably be enough for most cases.

Be aware that `myisamchk' uses temporary files in `TMPDIR'. If `TMPDIR'
points to a memory file system, you may easily get out of memory
errors. If this happens, set `TMPDIR' to point at some directory with
more space and restart `myisamchk'.

When repairing, `myisamchk' will also need a lot of disk space:

   * Double the size of the record file (the original one and a copy).
     This space is not needed if one does a repair with `--quick', as
     in this case only the index file will be re-created.  This space
     is needed on the same disk as the original record file!

   * Space for the new index file that replaces the old one. The old
     index file is truncated at start, so one usually ignore this space.
     This space is needed on the same disk as the original index file!

   * When using `--recover' or `--sort-recover' (but not when using
     `--safe-recover', you will need space for a sort buffer for:
     `(largest_key + row_pointer_length)*number_of_rows * 2'.  You can
     check the length of the keys and the row_pointer_length with
     `myisamchk -dv table'.  This space is allocated on the temporary
     disk (specified by `TMPDIR' or `--tmpdir=#').

If you have a problem with disk space during repair, you can try to use
`--safe-recover' instead of `--recover'.


automatically generated by info2www version 1.2.2.9