MySQL Archive: Difference between revisions

Content deleted Content added
BrianAker (talk | contribs)
Line 20:
== MySQL Archive Storage Engine ==
 
Archive is a storage engine for the [[MySQL]] relational database management system. ItUsers iscan anuse this analytic storage engine which allows a user to create a table whichthat is "archive"“archive” only. NoData data cancannot be deleted from thethis table, only added. The Archive engine uses a compression strategy based aroundon the [[Zlib]] library. Itand takes a row andit packs itthe byrows using a bit header to represent nulls and removes all whitespace for character type fields. OnceWhen this is donecompleted, the row is then inserted into the compression buffer and waits to be flushed to disk based on eitherby an explicit flush table, a read, or by the closing of the table.
 
The engine is not [[ACID]] compliant. Unlike [[OLTP]] engines, it uses a "stream" format to disk with no block boundaries. The head of the Archive file generated is a byte array representing the data format and contents of thethat file. In MySQL 5.1, a copy of the MySQL FRM file, which is usedstored to representin the definitionheader of aeach table,Archive beganfile. toThe beFRM storedfile, inwhich represents the headerdefinition of eacha Archive file. Thistable, allows an archiveArchive file to restorebe itselfrestored to a MySQL serversserver if itthe Archive file is copied aroundto like anythe ordinary fileserver.
 
Despite itsthe use of [[zlib]], Archive itfiles isare not compatible with gzio, the basis of the [[gzip]] tools. It uses its own azio system whichthat is a fork of gzio.
 
ItArchive differs from the other MySQL analytical engine, [[MyISAM]], by being a row level locking engine and by the fact that it keepskeeping a constant version snapshot throughout a single query (making it [[MVCC]]). This means that Archive willdoes not lock for concurrent bulk inserts. For bulk inserts it performs an interlaced INSERT, so unlike MyISAM, order is not guaranteed.
 
TheUsers toolcan archive_readeruse isthe providedarchive_reader that allows for a usertool to take an online snapshot of a table. It can also be usedand to change the characteristics of an archive file.
 
To create an Archive table, one has to specify the following engine string:
 
create table t1 (