To get a description of a table or statistics about it, use the commands shown below. We explain some of the information in more detail later.
isamchk -d nom_table
isamchk in ``describe mode'' to produce a description of your
table. If you start the MySQL server using the --skip-locking
option, isamchk may report an error for a table that is updated while
it runs. However, since isamchk doesn't change the table in describe
mode, there isn't any risk of destroying data.
isamchk -d -v nom_table
isamchk is doing, add -v
to tell it to run in verbose mode.
isamchk -eis nom_table
isamchk -eiv nom_table
-eis, but tells you what is being done.
Example of isamchk -d output:@:
ISAM file:@: company.ISM Data records:@: 1403698 Deleted blocks: 0 Recordlength:@: 226 Record format:@: Fixed length table description:@: Key Start Len Index Type 1 2 8 unique double 2 15 10 multip. text packed stripped 3 219 8 multip. double 4 63 10 multip. text packed stripped 5 167 2 multip. unsigned short 6 177 4 multip. unsigned long 7 155 4 multip. text 8 138 4 multip. unsigned long 9 177 4 multip. unsigned long 193 1 text
Example of isamchk -d -v output:@:
ISAM file:@: company.ISM Isam-version:@: 2 Creation time:@: 1996-08-28 11:44:22 Recover time:@: 1997-01-12 18:35:29 Data records:@: 1403698 Deleted blocks: 0 Datafile:@: Parts: 1403698 Deleted data: 0 Datafilepointer (bytes):@: 3 Keyfile pointer (bytes): 3 Max datafile length:@: 3791650815 Max keyfile length: 4294967294 Recordlength:@: 226 Record format:@: Fixed length table description:@: Key Start Len Index Type Root Blocksize Rec/key 1 2 8 unique double 15845376 1024 1 2 15 10 multip. text packed stripped 25062400 1024 2 3 219 8 multip. double 40907776 1024 73 4 63 10 multip. text packed stripped 48097280 1024 5 5 167 2 multip. unsigned short 55200768 1024 4840 6 177 4 multip. unsigned long 65145856 1024 1346 7 155 4 multip. text 75090944 1024 4995 8 138 4 multip. unsigned long 85036032 1024 87 9 177 4 multip. unsigned long 96481280 1024 178 193 1 text
Example of isamchk -eis output:@:
Checking ISAM file:@: company.ISM Key:@: 1: Keyblocks used: 97% Packed: 0% Max levels: 4 Key:@: 2: Keyblocks used: 98% Packed: 50% Max levels: 4 Key:@: 3: Keyblocks used: 97% Packed: 0% Max levels: 4 Key:@: 4: Keyblocks used: 99% Packed: 60% Max levels: 3 Key:@: 5: Keyblocks used: 99% Packed: 0% Max levels: 3 Key:@: 6: Keyblocks used: 99% Packed: 0% Max levels: 3 Key:@: 7: Keyblocks used: 99% Packed: 0% Max levels: 3 Key:@: 8: Keyblocks used: 99% Packed: 0% Max levels: 3 Key:@: 9: Keyblocks used: 98% Packed: 0% Max levels: 4 Total:@: Keyblocks used: 98% Packed: 17% Records:@: 1403698 M.recordlength: 226 Packed: 0% Recordspace used:@: 100% Empty space: 0% Blocks/Record: 1.00 Recordblocks:@: 1403698 Deleteblocks: 0 Recorddata:@: 317235748 Deleted data: 0 Lost space:@: 0 Linkdata: 0 User time 1626.51, System time 232.36 Maximum resident set size 0, Integral resident set size 0 Non physical pagefaults 0, Physical pagefaults 627, Swaps 0 Blocks in 0 out 0, Messages in 0 out 0, Signals 0 Voluntary context switches 639, Involuntary context switches 28966
Example of isamchk -eiv output:@:
Checking ISAM file:@: company.ISM Data records:@: 1403698 Deleted blocks: 0 - check file-size - check delete-chain index 1:@: index 2:@: index 3:@: index 4:@: index 5:@: index 6:@: index 7:@: index 8:@: index 9:@: No recordlinks - check index reference - check data record references index:@: 1 Key:@: 1: Keyblocks used: 97% Packed: 0% Max levels: 4 - check data record references index:@: 2 Key:@: 2: Keyblocks used: 98% Packed: 50% Max levels: 4 - check data record references index:@: 3 Key:@: 3: Keyblocks used: 97% Packed: 0% Max levels: 4 - check data record references index:@: 4 Key:@: 4: Keyblocks used: 99% Packed: 60% Max levels: 3 - check data record references index:@: 5 Key:@: 5: Keyblocks used: 99% Packed: 0% Max levels: 3 - check data record references index:@: 6 Key:@: 6: Keyblocks used: 99% Packed: 0% Max levels: 3 - check data record references index:@: 7 Key:@: 7: Keyblocks used: 99% Packed: 0% Max levels: 3 - check data record references index:@: 8 Key:@: 8: Keyblocks used: 99% Packed: 0% Max levels: 3 - check data record references index:@: 9 Key:@: 9: Keyblocks used: 98% Packed: 0% Max levels: 4 Total:@: Keyblocks used: 9% Packed: 17% - check records and index references [LOTS OF ROW NUMBERS DELETED] Records:@: 1403698 M.recordlength: 226 Packed: 0% Recordspace used:@: 100% Empty space: 0% Blocks/Record: 1.00 Recordblocks:@: 1403698 Deleteblocks: 0 Recorddata:@: 317235748 Deleted data: 0 Lost space:@: 0 Linkdata: 0 User time 1639.63, System time 251.61 Maximum resident set size 0, Integral resident set size 0 Non physical pagefaults 0, Physical pagefaults 10580, Swaps 0 Blocks in 4 out 0, Messages in 0 out 0, Signals 0 Voluntary context switches 10604, Involuntary context switches 122798
Here are the sizes of the data and index files for the table used in the preceding examples:@:
-rw-rw-r-- 1 monty tcx 317235748 Jan 12 17:@:30 company.ISD -rw-rw-r-- 1 davida tcx 96482304 Jan 12 18:@:35 company.ISM
Explanations for the types of information isamchk produces are given
below. The ``keyfile'' is the index file. ``Record'' and ``row'' are
synonymous.
ISAM file
Isam-version
Creation time
Recover time
Data records
Deleted blocks
Datafile:@: Parts
Data
records.
Deleted data
Datafile pointer
Keyfile pointer
Max datafile length
.ISD file) can become, in bytes.
Max keyfile length
.ISM file) can become, in bytes.
Recordlength
Record format
Fixed length.
Other possible values are Compressed and Packed.
table description
Key
Start
Len
Index
unique or multip. (multiple). Indicates whether or not one value
can exist multiple times in this index.
Type
packed, stripped or empty.
Root
Blocksize
Rec/key
isamchk -a. If this is not updated at all, a default
value of 30 is given.
Keyblocks used
isamchk, the values are very
high (very near the theoretical maximum).
Packed
CHAR/VARCHAR/DECIMAL keys. For long strings like
names, this can significantly reduce the space used. In the third example
above, the 4th key is 10 characters long and a 60% reduction in space is
achieved.
Max levels
Records
M.recordlength
Packed
Packed
value indicates the percentage savings achieved by doing this.
Recordspace used
Empty space
Blocks/Record
isamchk.
13.4.3 Optimisation de tables.
Recordblocks
Deleteblocks
Recorddata
Deleted data
Lost space
Linkdata
Linkdata is the sum of the amount of
storage used by all such pointers.
If a table has been compressed with pack_isam, isamchk -d
prints additional information about each table column. See pack_isam, for an example of this information and a description of
what it means.