Databases Reference
In-Depth Information
DEFAULT (or no setting)
Instructs MySQL to try to repair any table that is marked as having crashed or not
marked as having been closed cleanly. The default setting performs no other actions
upon recovery. In contrast to how most variables work, this DEFAULT value is not
an instruction to reset the variable to its compiled-in value; it essentially means “no
setting.”
BACKUP
Makes MySQL write a backup of the data file into a .BAK file, which you can
examine afterward.
FORCE
Makes recovery continue even if more than one row will be lost from the .MYD file.
QUICK
Skips recovery unless there are delete blocks. These are blocks of deleted rows that
are still occupying space and can be reused for future INSERT statements. This can
be useful because MyISAM recovery can take a very long time on large tables.
You can use multiple settings, separated by commas. For example, BACKUP,FORCE will
force recovery and create a backup. This is what we used in our sample configuration
file earlier in this chapter.
We recommend that you enable this option, especially if you have just a few small
MyISAM tables. Running a server with corrupted MyISAM tables is dangerous, because
they can sometimes cause more data corruption and even server crashes. However, if
you have large tables, automatic recovery might be impractical: it causes the server to
check and repair all MyISAM tables when they're opened, which is inefficient. During
this time, MySQL tends to block connections from performing any work. If you have
a lot of MyISAM tables, it might be a good idea to use a less intrusive process that runs
CHECK TABLES and REPAIR TABLES after startup. 12 Either way, it is very important to check
and repair the tables.
Enabling memory-mapped access to data files is another useful MyISAM option. Mem-
ory mapping lets MyISAM access the .MYD files directly via the operating system's
page cache, avoiding costly system calls. In MySQL 5.1 and newer, you can enable
memory mapping with the myisam_use_mmap option. Older versions of MySQL use
memory mapping for compressed MyISAM tables only.
Configuring MySQL Concurrency
When you're running MySQL in a high-concurrency workload, you might run into
bottlenecks you wouldn't otherwise experience. This section explains how to detect
12. Some Debian systems do this automatically, which is a swing of the pendulum too far in the other
direction. It's not a good idea to just configure this behavior by default as Debian does; the DBA should
decide.
 
Search WWH ::




Custom Search