This section discusses mapping of MySQL database objects to the NDB API.
Databases and Schemas.
Databases and schemas are not represented by objects as such
in the NDB API. Instead, they are modelled as attributes of
Index objects. The value of
database attribute of one of these
objects is always the same as the name of the MySQL database
to which the table or index belongs. The value of the
schema attribute of a
Index object is always
def' (for “default”).
MySQL table names are directly mapped to
NDB table names without modification. Table
names starting with '
NDB$' are reserved for
internal use, as is the
SYSTAB_0 table in
Indexes. There are two different type of NDB indexes:
Hash indexes are unique, but not ordered.
B-tree indexes are ordered, but permit duplicate values.
Names of unique indexes and primary keys are handled as follows:
For a MySQL
UNIQUEindex, both a B-tree and a hash index are created. The B-tree index uses the MySQL name for the index; the name for the hash index is generated by appending '
$unique' to the index name.
For a MySQL primary key only a B-tree index is created. This index is given the name
PRIMARY. There is no extra hash; however, the uniqueness of the primary key is guaranteed by making the MySQL key the internal primary key of the
Column Names and Values.
NDB column names are the same as their