CREATE TABLE
Syntax
1037
These options work only when you are not using the
--skip-symbolic-links
[421]
option. Your
operating system must also have a working, thread-safe
realpath()
call. See
Section 8.9.6.2,
“Using Symbolic Links for
MyISAM
Tables on Unix”
, for more complete information.
If a
MyISAM
table is created with no
DATA DIRECTORY
option, the
.MYD
file is created in the
database directory. By default, if
MyISAM
finds an existing
.MYD
file in this case, it overwrites it.
The same applies to
.MYI
files for tables created with no
INDEX DIRECTORY
option. As of MySQL
5.0.48, to suppress this behavior, start the server with the
--keep_files_on_create
[458]
option,
in which case
MyISAM
will not overwrite existing files and returns an error instead.
If a
MyISAM
table is created with a
DATA DIRECTORY
or
INDEX DIRECTORY
option and an existing
.MYD
or
.MYI
file is found, MyISAM always returns an error. It will not overwrite a file in the specified
directory.
Important
Beginning with MySQL 5.0.60, you cannot use path names that contain the
MySQL data directory with
DATA DIRECTORY
or
INDEX DIRECTORY
. (See
Bug #32167.)
•
DELAY_KEY_WRITE
Set this to 1 if you want to delay key updates for the table until the table is closed. See the
description of the
delay_key_write
[447]
system variable in
Section 5.1.4, “Server System
Variables”
. (
MyISAM
only.)
•
INSERT_METHOD
If you want to insert data into a
MERGE
table, you must specify with
INSERT_METHOD
the table into
which the row should be inserted.
INSERT_METHOD
is an option useful for
MERGE
tables only. Use a
value of
FIRST
or
LAST
to have inserts go to the first or last table, or a value of
NO
to prevent inserts.
See
Section 14.3, “The
MERGE
Storage Engine”
.
•
MAX_ROWS
The maximum number of rows you plan to store in the table. This is not a hard limit, but rather a hint
to the storage engine that the table must be able to store at least this many rows.
The
NDB
storage engine treats this value as a maxmimum. If you plan to create very large MySQL
Cluster tables (containing millions of rows), you should use this option to insure that
NDB
allocates
sufficient number of index slots in the hash table used for storing hashes of the table's primary keys
by setting
MAX_ROWS = 2 * rows
, where
rows
is the number of rows that you expect to insert into
the table.
The maximum
MAX_ROWS
value is 4294967295; larger values are truncated to this limit.
•
MIN_ROWS
The minimum number of rows you plan to store in the table. The
MEMORY
storage engine uses this
option as a hint about memory use.
•
PACK_KEYS
PACK_KEYS
takes effect only with
MyISAM
tables. Set this option to 1 if you want to have smaller
indexes. This usually makes updates slower and reads faster. Setting the option to 0 disables all
packing of keys. Setting it to
DEFAULT
tells the storage engine to pack only long
CHAR
,
VARCHAR
,
BINARY
, or
VARBINARY
columns.
If you do not use
PACK_KEYS
, the default is to pack strings, but not numbers. If you use
PACK_KEYS=1
, numbers are packed as well.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...