MyISAM
   HOME

TheInfoList



OR:

MyISAM was the default
storage engine A database engine (or storage engine) is the underlying software component that a database management system (DBMS) uses to create, read, update and delete (CRUD) data from a database. Most database management systems include their own application ...
for the
MySQL MySQL () is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A relational database o ...
relational database management system A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relatio ...
versions prior to 5.5 released in December 2009. It is based on the older
ISAM ISAM (an acronym for indexed sequential access method) is a method for creating, maintaining, and manipulating computer files of data so that records can be retrieved sequentially or randomly by one or more keys. Indexes of key fields are mainta ...
code, but it has many useful extensions.


Filesystem

Each MyISAM table is stored on disk in three files (if it is not partitioned). The files have names that begin with the table name and have an extension to indicate the file type. MySQL uses a .frm file to store the definition of the table, but this file is not a part of the MyISAM engine; instead it is a part of the server. The data file has a .MYD (MYData) extension. The index file has a .MYI (MYIndex) extension. The index file, if lost, can always be recreated by recreating indexes. Files format depends on the ROW_FORMAT table option. The following formats are available: * FIXED: Fixed is a format where all data (including variable-length types) have a fixed length. This format is faster to read, and improves corrupted tables repair. If a table contains big variable-length columns (BLOB or TEXT) it cannot use the FIXED format. * DYNAMIC: Variable-length columns do not have a fixed length size. This format is a bit slower to read but saves some space on disk. * COMPRESSED: Compressed tables can be created with a dedicated tool while MySQL is not running, and they are read-only. While this usually makes them a non-viable option, the compression rate is generally sensibly higher than alternatives. MyISAM files do not depend on the system and, since MyISAM is not transactional, their content does not depend on current server workload. Therefore it is possible to copy them between different servers.


Features

MyISAM is optimized for environments with heavy read operations, and few writes, or none at all. A typical area in which one could prefer MyISAM is
data warehouse In computing, a data warehouse (DW or DWH), also known as an enterprise data warehouse (EDW), is a system used for Business reporting, reporting and data analysis and is considered a core component of business intelligence. DWs are central Repos ...
because it involves queries on very big tables, and the update of such tables is done when the database is not in use (usually at night). The reason MyISAM allows for fast reads is the structure of its indexes: each entry points to a record in the data file, and the pointer is offset from the beginning of the file. This way records can be quickly read, especially when the format is FIXED. Thus, the rows are of constant length. Inserts are easy too because new rows are appended to the end of the data file. However, delete and update operations are more problematic: deletes must leave an empty space, or the rows' offsets would change; the same goes for updates, as the length of the rows becomes shorter; if the update makes the row longer, the row is fragmented. To defragment rows and claim empty space, the OPTIMIZE TABLE command must be executed. Because of this simple mechanism, MyISAM index statistics are usually quite accurate. However, the simplicity of MyISAM has several drawbacks. The major deficiency of MyISAM is the absence of transactions support. Also,
foreign key A foreign key is a set of attributes in a table that refers to the primary key of another table. The foreign key links these two tables. Another way to put it: In the context of relational databases, a foreign key is a set of attributes subject to ...
s are not supported. In normal use cases, InnoDB seems to be faster than MyISAM. Versions of MySQL 5.5 and greater have switched to the
InnoDB InnoDB is a database engine, storage engine for the database management system MySQL and MariaDB. Since the release of MySQL 5.5.5 in 2010, it replaced MyISAM as MySQL's default table type. It provides the standard ACID-compliant Database transact ...
engine to ensure
referential integrity Referential integrity is a property of data stating that all its references are valid. In the context of relational databases, it requires that if a value of one attribute (column) of a relation (table) references a value of another attribute (ei ...
constraints, and higher concurrency. MyISAM supports FULLTEXT indexing and OpenGIS data types.


Forks

MariaDB MariaDB is a community-developed, commercially supported fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. Development is led by some of the ori ...
has a storage engine called
Aria In music, an aria (Italian: ; plural: ''arie'' , or ''arias'' in common usage, diminutive form arietta , plural ariette, or in English simply air) is a self-contained piece for one voice, with or without instrumental or orchestral accompanime ...
, which is described as a "crash-safe alternative to MyISAM". However, the MariaDB developers still work on MyISAM code. The major improvement is the "Segmented Key Cache". If it is enabled, MyISAM indices' cache is divided into segments. This improves the concurrency because threads rarely need to lock the entire cache. In MariaDB, MyISAM also supports
virtual column In relational databases a virtual column is a table column whose value is automatically computed using other columns values, or another deterministic expression. Virtual columns are defined of SQL:2003 as Generated Column, and are only implemented ...
s.
Drizzle Drizzle is a light precipitation consisting of liquid water drops smaller than those of rain – generally smaller than in diameter. Drizzle is normally produced by low stratiform clouds and stratocumulus clouds. Precipitation rates from dri ...
does not include MyISAM.


See also

*
Comparison of MySQL database engines This is a comparison between notable database engines for the MySQL database management system (DBMS). A database engine (or "storage engine") is the underlying software component that a DBMS uses to create, read, update and delete (CRUD) data ...


Notes


External links


MySQL Documentation on MyISAM Storage Engine

MyISAM's open files limit and table-cache problem explained

The article about problems which will occur in using MyISAM

MySQL Engines - MyISAM vs Innodb
by Rackspace (Archived on 2015-02-08)
Convert your MySQL database from MyISAM to InnoDB, and get ready for Drupal 7 at the same time
(Archived on 2013-03-08)
Converting Tables from MyISAM to InnoDB
{{DEFAULTSORT:Myisam Database engines MySQL