8.8. The ARCHIVE Storage EngineThe ARCHIVE storage engine is used for storing large amounts of data without indexes in a very small footprint. The ARCHIVE storage engine is included in MySQL binary distributions. To enable this storage engine if you build MySQL from source, invoke configure with the --with-archive-storage-engine option. To examine the source for the ARCHIVE engine, look in the sql directory of a MySQL source distribution. You can check whether the ARCHIVE storage engine is available with this statement:
mysql>
SHOW VARIABLES LIKEhave_archive';
When you create an
ARCHIVE
table, the server creates a table format file in the database directory. The file begins with the table
The
ARCHIVE
engine supports
INSERT
and
SELECT
, but not
DELETE
,
REPLACE
, or
UPDATE
. It does support
ORDER BY
operations,
BLOB
Storage : Rows are compressed as they are inserted. The ARCHIVE engine uses zlib lossless data compression (see http://www.zlib.net/ ). You can use OPTIMIZE TABLE to analyze the table and pack it into a smaller format (for a reason to use OPTIMIZE TABLE , see later in this section). Beginning with MySQL 5.0.15, the engine also supports CHECK TABLE . There are several types of insertions that are used:
Retrieval
: On retrieval, rows are uncompressed on demand; there is no row cache. A
SELECT
operation
Additional resources
|
8.9. The CSV Storage EngineThe CSV storage engine stores data in text files using comma-separated values format. To enable this storage engine, use the --with-csv-storage-engine option to configure when you build MySQL. The CSV storage engine is included in MySQL-Max binary distributions. To enable this storage engine if you build MySQL from source, invoke configure with the --with-csv-storage-engine option. To examine the source for the CSV engine, look in the sql/examples directory of a MySQL source distribution.
When you create a
CSV
table, the server creates a table format file in the database directory. The file begins with the table
mysql> CREATE TABLE test(i INT, c CHAR(10)) ENGINE = CSV; Query OK, 0 rows affected (0.12 sec) mysql> INSERT INTO test VALUES(1,'record one'),(2,'record two'); Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM test; +------+------------+ i c +------+------------+ 1 record one 2 record two +------+------------+ 2 rows in set (0.00 sec)
If you examine the
test.CSV
file in the database directory created by executing the
"1", "record one" "2", "record two" The CSV storage engine does not support indexing. |