Oracle 5.0 Reference Manual page 1037

Table of Contents

Advertisement

values specify additional options for an index.
index_option
about permissible
index_option
• After an
ALTER TABLE
cardinality information. See
enables you to create the new table with the rows in a specific order. Note that the table
ORDER BY
does not remain in this order after inserts and deletes. This option is useful primarily when you know
that you are mostly to query the rows in a certain order most of the time. By using this option after
major changes to the table, you might be able to get higher performance. In some cases, it might
make sorting easier for MySQL if the table is in order by the column that you want to order it by later.
syntax permits one or more column names to be specified for sorting, each of which
ORDER BY
optionally can be followed by
respectively. The default is ascending order. Only column names are permitted as sort criteria;
arbitrary expressions are not permitted. This clause should be given last after any other clauses.
does not make sense for
ORDER BY
(PRIMARY KEY
or
NOT NULL UNIQUE
an index if one is present. The same is true for
KEY.
If you use
ALTER TABLE
batch (as for
REPAIR
indexes.
This feature can be activated explicitly for a
tells MySQL to stop updating nonunique indexes.
be used to re-create missing indexes. MySQL does this with a special algorithm that is much faster
than inserting keys one by one, so disabling keys before performing bulk insert operations should
give a considerable speedup. Using
privilege in addition to the privileges mentioned earlier.
While the nonunique indexes are disabled, they are ignored for statements such as
that otherwise would use them.
EXPLAIN
• If
for an
ALTER TABLE
column is truncated), InnoDB's
caused by changing the values.
The
FOREIGN KEY
which implements
ADD [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (...)
(...). See
REFERENCES ...
other storage engines, the clauses are parsed but ignored. The
by all storage engines. See
ignoring syntax clauses is for compatibility, to make it easier to port code from other SQL servers,
and to run applications that create tables with references. See
from Standard
SQL".
For
TABLE, unlike
ALTER
uses an automatically generated foreign key name. As a workaround, include the
clause to specify the foreign key name:
ADD CONSTRAINT
name
Important
The inline
part of the column specification are silently ignored by InnoDB. InnoDB only
ALTER TABLE
values, see
statement, it may be necessary to run
Section 13.7.5.18,
or
to indicate ascending or descending sort order,
ASC
DESC
InnoDB
index).
on a
table, all nonunique indexes are created in a separate
MyISAM
TABLE). This should make
MyISAM
ALTER TABLE ... DISABLE KEYS
table results in changes to column values (for example, because a
InnoDB
FOREIGN KEY
and
clauses are supported by the
REFERENCES
Section 14.2.3.4,
Section 13.1.10,
CREATE
TABLE,
FOREIGN KEY (....) ...
specifications where the references are defined as
REFERENCES
1017
Syntax
USING
Section 13.1.8,
"CREATE INDEX
ANALYZE TABLE
"SHOW INDEX
Syntax".
tables that contain a user-defined clustered index
always orders table rows according to such
InnoDB
tables that contain a user-defined
BDB
much faster when you have many
ALTER TABLE
table.
ALTER TABLE ... DISABLE KEYS
ALTER TABLE ... ENABLE KEYS
constraint checks do not notice possible violations
"InnoDB
and
FOREIGN KEY
CHECK
"CREATE TABLE
Syntax". The reason for accepting but
Section 1.8.5, "MySQL Differences
ignores
ADD FOREIGN KEY
is one such option. For details
Syntax".
to update index
PRIMARY
then should
requires the
INDEX
and
SELECT
storage engine,
InnoDB
Constraints". For
clause is parsed but ignored
if given and
index_name
CONSTRAINT
[577]

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents