myisampack and pack_isam

The myisampack and pack_isam utilities produce compressed, read-only tables. They achieve typical storage requirement reductions of 40 to 70 percent while maintaining fast record access. myisampack packs MyISAM tables and works with all column types. pack_isam packs ISAM tables and works only with tables that contain no BLOB or TEXT columns.

myisampack and pack_isam are not included with MySQL by default but are available to customers that order 10 or more licenses or that have a support agreement at the extended support level or higher. This may change so that the programs are available under the same terms as the rest of the MySQL distribution. (See the MySQL Reference Manual for current support and licensing information.)

No special version of MySQL is needed to read tables that have been packed with these utilities. This makes them especially applicable for applications for which you wish to distribute a table containing archival or encyclopedic information that is read-only and need not be updated. If you want to convert a packed file back to unpacked and modifiable form, you can do so by using myisamchk --unpack (for MyISAM tables) or isamchk --unpack (for ISAM tables).

myisampack and isam_pack pack data files, but do not touch index files. To update the indexes, run myisamchk -rq after running myisampack or isamchk -rq after running pack_isam.

Usage

myisampack [options] tbl_name …
pack_isam [options] tbl_name

A tbl_name argument can be either the name of a table or the name of the index file for the table (a .MYI file for MyISAM tables and an .ISM file for ISAM tables). Specify the pathname to the directory in which the table is located if you are not in that directory.

Standard Options Supported by myisampack and pack_isam

--debug         --silent        --version
--help          --verbose

Options Common to myisampack and pack_isam

  • -b,--backup
    

    Tells myisampack or pack_isam to make a backup of each tbl_name argument as tbl_name.OLD before packing it.

  • -f,--force
    

    Forces a table to be packed even if the resulting packed file is larger than the original or if a temporary file for the table already exists. Normally, myisampack or pack_isam simply exit after printing an error message if they find a file tbl_name.TMD because that may indicate that another instance of the program is already running. However, the file may also exist if you killed a previous invocation of the program while it was running, in which case the file may be removed safely. If you know that to be the case, use --force to tell either utility to pack the table even if the temporary file exists.

  • -j join_tbl, --join=join_tbl
    								

    Joins (merges) all the tables named on the command line into a single packed table—join_tbl. All the tables to be merged must have the same structure. (Column names, types, and indexes must be identical.)

  • -t, --test
    

    Runs in test mode. A packing test is run, and information is printed about the results you would obtain if you actually packed the table.

  • -T path_name, --tmpdir=path_name
    								

    Specifies the pathname of the directory to use for temporary files.

  • -w, --wait
    

    Waits and retries if a table is in use. You don't want to pack a table if it might be updated while you're packing it.

Options Specific to pack_isam

Although there are no options specific to myisampack, there is one specific to pack_isam, -p n, --packlength=n. This option tells pack_isam to use a record length storage size of n bytes, where n is an integer from 1 to 3. pack_isam automatically attempts to determine the number of bytes needed to record the length of each record in the packed table. In some cases, it may determine that a smaller length could have been used. If so, pack_isam issues a message to that effect. You can run pack_isam again and explicitly specify the smaller length with a --packlength option to achieve some additional space savings.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.166.98