14.8. The ARCHIVE Storage Engine

MySQL 5.0

14.8. The ARCHIVE Storage Engine

The storage engine is used for storing large amounts of data without indexes in a very small footprint.

The storage engine is included in MySQL binary distributions. To enable this storage engine if you build MySQL from source, invoke configure with the option.

To examine the source for the engine, look in the directory of a MySQL source distribution.

You can check whether the storage engine is available with this statement:

mysql> 

When you create an table, the server creates a table format file in the database directory. The file begins with the table name and has an extension. The storage engine creates other files, all having names beginning with the table name. The data and metadata files have extensions of and , respectively. An file may appear during optimization operations.

The engine supports and , but not , , or . It does support operations, columns, and basically all but spatial data types (see Section 16.4.1, “MySQL Spatial Data Types”). The engine uses row-level locking.

Storage: Rows are compressed as they are inserted. The engine uses lossless data compression (see http://www.zlib.net/). You can use to analyze the table and pack it into a smaller format (for a reason to use , see later in this section). Beginning with MySQL 5.0.15, the engine also supports . There are several types of insertions that are used:

  • An statement just pushes rows into a compression buffer, and that buffer flushes as necessary. The insertion into the buffer is protected by a lock. A forces a flush to occur, unless the only insertions that have come in were (those flush as necessary). See Section 13.2.4.2, “ Syntax”.

  • A bulk insert is visible only after it completes, unless other inserts occur at the same time, in which case it can be seen partially. A never causes a flush of a bulk insert unless a normal insert occurs while it is loading.

Retrieval: On retrieval, rows are uncompressed on demand; there is no row cache. A operation performs a complete table scan: When a occurs, it finds out how many rows are currently available and reads that number of rows. is performed as a consistent read. Note that lots of statements during insertion can deteriorate the compression, unless only bulk or delayed inserts are used. To achieve better compression, you can use or . The number of rows in tables reported by is always accurate. See Section 13.5.2.5, “ Syntax”, Section 13.5.2.6, “ Syntax”, and Section 13.5.4.21, “ Syntax”.

Additional resources