MyISAM System Variables
This page documents system variables related to the MyISAM storage engine. For options, see MyISAM Options.
See Server System Variables for a complete list of system variables and instructions on setting them.
See also the Full list of MariaDB options, system and status variables.
key_buffer_size
key_buffer_sizeDescription: Size of the buffer for the index blocks used by MyISAM tables and shared for all threads. See Optimizing key_buffer_size for more on selecting the best value.
Command line:
--key-buffer-size=#Scope: Global
Dynamic: Yes
Data Type:
numericDefault Value:
134217728Range:
8upwards (upper limit determined by operating system per process limit)
key_cache_age_threshold
key_cache_age_thresholdDescription: The lower the setting, the more quickly buffers move from the hot key cache sublist to the warm sublist.
Command line:
--key-cache-age-threshold=#Scope: Global
Dynamic: Yes
Data Type:
numericDefault Value:
300Range:
100to4294967295
key_cache_block_size
key_cache_block_sizeDescription: MyISAM key cache block size in bytes .
Command line:
--key-cache-block-size=#Scope: Global
Dynamic: Yes
Data Type:
numericDefault Value:
1024Range:
512to16384
key_cache_division_limit
key_cache_division_limitDescription: Percentage to use for the warm key cache buffer list (the remainder is allocated between the hot and cold caches).
Command line:
--key-cache-division-limit=#Scope: Global
Dynamic: Yes
Data Type:
numericDefault Value:
100Range:
1to100
key_cache_file_hash_size
key_cache_file_hash_sizeDescription: Number of hash buckets for open and changed files. If you have many MyISAM files open you should increase this for faster flushing of changes. A good value is probably 1/10th of the number of possible open MyISAM files.
Command line:
--key-cache-file-hash-size=#Scope: Global
Dynamic: Yes
Data Type:
numericDefault Value:
512Range:
128to16384
key_cache_segments
key_cache_segmentsDescription: The number of segments in a key cache. See Segmented Key Cache.
Command line:
--key-cache-segments=#Scope: Global
Dynamic: Yes
Type: numeric
Default Value:
0(non-segmented)Range:
0to64
myisam_block_size
myisam_block_sizeDescription: Block size to be used for MyISAM index pages.
Command line:
--myisam-block-size=#Scope: Global
Dynamic: No
Data Type:
numericDefault Value:
1024
myisam_data_pointer_size
myisam_data_pointer_sizeDescription: Size in bytes of the default pointer, used in a MyISAM CREATE TABLE with no MAX_ROWS option.
Command line:
--myisam-data-pointer-size=#Scope: Global
Dynamic: Yes
Data Type:
numericDefault Value:
6Range:
2to7
myisam_max_extra_sort_file_size
myisam_max_extra_sort_file_sizeDescription: Removed in MySQL 5.0.6, was used as a way to force long character keys in large tables to use the key cache method.
Removed: MySQL 5.0.6
myisam_max_sort_file_size
myisam_max_sort_file_sizeDescription: Maximum size in bytes of the temporary file used while recreating a MyISAM index. If the this size is exceeded, the slower process of using the key cache is done instead.
Command line:
--myisam-max-sort-file-size=#Scope: Global
Dynamic: Yes
Data Type:
numericDefault Value - 32 bit:
2147483648Default Value - 64 bit:
9223372036854775807
myisam_mmap_size
myisam_mmap_sizeDescription: Maximum memory in bytes that can be used for memory mapping compressed MyISAM files. Too high a value may result in swapping if there are many compressed MyISAM tables.
Command line:
--myisam-mmap-size=#Scope: Global, Session
Dynamic: Yes
Data Type:
numericDefault Value - 32 bit:
4294967295Default Value - 64 bit:
18446744073709547520Range - 32-bit:
7to4294967295Range - 64-bit:
7to18446744073709547520
myisam_recover_options
myisam_recover_optionsDescription: MyISAM recovery mode. Multiple options can be selected, comma-delimited. Using no argument is equivalent to specifying
DEFAULT, while specifying "" is equivalent toOFF. If enabled each time the server opens a MyISAM table, it checks whether it has been marked as crashed, or wasn't closed properly. If so, mysqld will run a check and then attempt to repair the table, writing to the error log beforehand.OFF: No recovery.
BACKUP: If the data file is changed while recovering, saves a backup of the .MYD data file. t.MYD are saved as t.MYD-datetime.BAK.
BACKUP_ALL: Same as
BACKUPbut also backs up the .MYI index file. t.MYI are saved as t.MYI-datetime.BAK.DEFAULT: Recovers without backing up, forcing, or quick checking.
FORCE: Runs the recovery even if it determines that more than one row from the data file are lost.
QUICK: Does not check rows in the table if there are no delete blocks.
Command line:
--myisam-recover-options[=name]Scope: Global
Dynamic: No
Data Type:
enumerationDefault Value:
BACKUP,QUICK(>= MariaDB 10.2.4)DEFAULT(<= MariaDB 10.2.3)OFF
Valid Values:
OFF,DEFAULT,BACKUP,BACKUP_ALL,FORCEorQUICK
myisam_repair_threads
myisam_repair_threadsDescription: If set to more than
1, the default, MyISAM table indexes each have their own thread during repair and sorting. Increasing from the default will usually result in faster repair, but will use more CPU and memory.Command line:
--myisam-repair-threads=#Scope: Global, Session
Dynamic: Yes
Data Type:
numericDefault Value:
1Range - 32-bit:
1to4294967295Range - 64-bit:
1to18446744073709547520
myisam_sort_buffer_size
myisam_sort_buffer_sizeDescription: Size in bytes of the buffer allocated when creating or sorting indexes on a MyISAM table. Increase for better myisamchk -r, --recover performance.
Command line:
--myisam-sort-buffer-size=#Scope: Global, Session
Dynamic: Yes
Data Type:
BIGINT UNSIGNEDDefault Value:
134216704Range:
(>= MariaDB 10.11.5, MariaDB 10.6.15): 4096to1152921504606846975(<= MariaDB 10.11.4, MariaDB 10.6.14): 4096to18446744073709551615
myisam_stats_method
myisam_stats_methodDescription: Determines how NULLs are treated for the purposes of MyISAM index statistics. If set to
nulls_equal, all NULL index values are treated as a single group. This is usually fine, but if you have large numbers of NULLs the average group size is slanted higher, and the optimizer may miss using the index for ref accesses when it would be useful. If set tonulls_unequal, the default, the opposite approach is taken, with each NULL forming its own group of one. Conversely, the average group size is slanted lower, and the optimizer may use the index for ref accesses when not suitable. Setting tonulls_ignoredignores NULLs altogether from index group calculations. See also Index Statistics, aria_stats_method, innodb_stats_method.Command line:
--myisam-stats-method=nameScope: Global, Session
Dynamic: Yes
Data Type:
enumerationDefault Value:
NULLS_UNEQUALValid Values:
NULLS_UNEQUAL, NULLS_EQUAL, NULLS_IGNORED
myisam_use_mmap
myisam_use_mmapDescription: If set to
1(0 is default), memory mapping are used to reading and writing MyISAM tables.Command line:
--myisam-use-mmapScope: Global
Dynamic: Yes
Data Type:
booleanDefault Value:
OFF
This page is licensed: CC BY-SA / Gnu FDL
Last updated
Was this helpful?

