| 1 |
New features compared to NISAM: |
| 2 |
|
| 3 |
- All file positions have type my_off_t; This enables one to use big |
| 4 |
files (2^63 byte) by defining my_off_t to be longlong on OS that supports |
| 5 |
big files. |
| 6 |
- When creating a table, one can now specify the maximum data file length. |
| 7 |
This will be used to calculate the length of row pointers. |
| 8 |
- All key segments have their own language definition. |
| 9 |
- Some changes to support more types: |
| 10 |
The biggest change is that the interface allows MY_ISAM will support |
| 11 |
variable length integer types. (Only the interface is implemented) |
| 12 |
- All data is stored with low byte first; This makes the data machine |
| 13 |
independent. |
| 14 |
- All number keys are stored with high byte first to give better packing. |
| 15 |
- Support for a true VARCHAR type; A VARCHAR column starts with a length |
| 16 |
stored on 2 bytes. |
| 17 |
- Tables with VARCHAR may have fixed or dynamic record length. |
| 18 |
- There are now 2 different ways to pack keys: |
| 19 |
- If the first key part is a space stripped CHAR, a VARCHAR or a BLOB the |
| 20 |
'packed' method is used. This only prefix-compresses the first |
| 21 |
key part. |
| 22 |
- In other cases prefix packing is used (This also includes the record |
| 23 |
pointer into the prefix packing). A key may in the best case be |
| 24 |
packed on 2 bytes. |
| 25 |
- VARCHAR and CHAR may be up to 65K |
| 26 |
- Index on BLOB and VARCHAR. |
| 27 |
- One can now have NULL in an index. This takes 0-1 bytes / key. |
| 28 |
- MYISAM will allow one to specify one AUTO_INCREMENT column; MYISAM will |
| 29 |
automatically update this on INSERT/UPDATE. The AUTO_INCREMENT value can be |
| 30 |
reset with myisamchk. |
| 31 |
- Max key length will be 500 by default; In cases of longer keys than 250, |
| 32 |
a bigger key block size than the default of 1024 byes is used for this key. |
| 33 |
- Max number of keys enlarged to 32 as default. This can be enlarged to 64 |
| 34 |
without having to recompile myisamchk. |
| 35 |
- There is a flag in the MYISAM header that tells if the index file (.MYI) |
| 36 |
was closed correctly. |
| 37 |
- myisamchk will now mark tables as checked. 'myisamchk --fast' will only |
| 38 |
check those tables that doesn't have this mark. |
| 39 |
- 'myisamchk -a' stores statistic for key parts (and not only for whole keys |
| 40 |
as in NISAM). |
| 41 |
- Dynamic size rows will now be much less fragmented when mixing deletes with |
| 42 |
update and insert. This is done by automatically combining adjacent deleted |
| 43 |
blocks and by extending blocks if the next block is deleted. |
| 44 |
- For dynamic size rows, the delete link contains a pointer to itself |
| 45 |
(to make repairs easier). |
| 46 |
- myisampack (called pack_isam in NISAM) can pack BLOB and VARCHAR |
| 47 |
columns. |
| 48 |
- One can now disable any key from update; In NISAM one could only disable |
| 49 |
the last x keys. |
| 50 |
- One can have a UNIQUE constraint on anything (including BLOBS). |
| 51 |
This is implemented by a key that contains a hashed number of the whole |
| 52 |
record and before inserting a new record, MyISAM will check all records |
| 53 |
with the same hash for dupplicates. |
| 54 |
- When creating the table, one can define that MyISAM should maintain |
| 55 |
a CRC for the whole table (to make isamchk even better). In the case of |
| 56 |
dynamic size rows, one will in this case get 1 byte checksum for each row. |
| 57 |
(This is a great help for debugging, but it can also be used to keep |
| 58 |
MyISAM table 'extra' safe. |
| 59 |
- Temporary tables will not write not flushed keys to file on close and |
| 60 |
not wait on 'disk full' conditions. |
| 61 |
|
| 62 |
Interface changes compared to NISAM: |
| 63 |
|
| 64 |
- mi_create() |
| 65 |
- keyinfo->seg must be allocated explicitly. |
| 66 |
- One must put number of key segments in keyinfo |