Cursos de MySQL en México, bases de datos, MySQL, sql, México Cursos de MySQL en México, bases de datos, MySQL, sql, México

Motores de almacenamiento de MySQL

Cursos de MySQL en México, bases de datos, MySQL, sql, México

motores de almacenamiento de MySQL

Cursos de MySQL en México, bases de datos, MySQL, sql, México
  Cursos de MySQL en México, bases de datos, MySQL, sql, México

84000.com.mx [ capacitación ]

Cursos de MySQL en México, bases de datos, MySQL, sql, México
Cursos de MySQL en México, bases de datos, MySQL, sql, México

Ofrecemos
  • Cursos personalizados, tu eliges, ya fecha inicio el horario y la frecuencia.
  • Todos los cursos son en la comodidad de tu casa y/o en tu oficina
  • Instructores altamente capacitados en la materia con años de experincia profesional y docente.
  • Material de apoyo para estudio fuera del centro de capacitación.
  • Soporte via telefónica sin costo alguno durante un año.
  • Cursos diseñados por profesionales en la materia donde te llevarán de la mano desde las bases de la materia hasta los puntos más profundos paso a paso y sin perder detalle.

Motores de almacenamiento de MySQL

Motor de almacenamiento MERGE

The MERGE storage engine was introduced in MySQL 3.23.25. It is also known as the MRG_MyISAM engine.

A MERGE table is a collection of identical MyISAM tables that can be used as one. “Identical” means that all tables have identical column and index information. You cannot merge MyISAM tables in which the columns are listed in a different order, do not have exactly the same columns, or have the indexes in different order. However, any or all of the MyISAM tables can be compressed with myisampack. See Section 8.6, “myisampack — Generate Compressed, Read-Only MyISAM Tables”. Differences in table options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS do not matter.

When you create a MERGE table, MySQL creates two files on disk. The files have names that begin with the table name and have an extension to indicate the file type. An .frm file stores the table format, and an .MRG file contains the names of the tables that should be used as one. (Originally, all used tables had to be in the same database as the MERGE table itself. This restriction has been lifted as of MySQL 4.1.1.)

You can use SELECT, DELETE, UPDATE, and (as of MySQL 4.0) INSERT on MERGE tables. You must have SELECT, UPDATE, and DELETE privileges on the MyISAM tables that you map to a MERGE table.

Note: The use of MERGE tables entails the following security issue: If a user has access to MyISAM table t, that user can create a MERGE table m that accesses t. However, if the user's privileges on t are subsequently revoked, the user can continue to access t by doing so through m. If this behavior is undesirable, you can start the server with the new --skip-merge option to disable the MERGE storage engine. This option is available as of MySQL 4.1.21.

If you DROP the MERGE table, you are dropping only the MERGE specification. The underlying tables are not affected.

To create a MERGE table, you must specify a UNION=(list-of-tables) clause that indicates which MyISAM tables you want to use as one. You can optionally specify an INSERT_METHOD option if you want inserts for the MERGE table to take place in the first or last table of the UNION list. Use a value of FIRST or LAST to cause inserts to be made in the first or last table, respectively. If you do not specify an INSERT_METHOD option or if you specify it with a value of NO, attempts to insert rows into the MERGE table result in an error.

The following example shows how to create a MERGE table:

mysql> CREATE TABLE t1 (
-> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> message CHAR(20)) ENGINE=MyISAM;
mysql> CREATE TABLE t2 (
-> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> message CHAR(20)) ENGINE=MyISAM;
mysql> INSERT INTO t1 (message) VALUES ('Testing'),('table'),('t1');
mysql> INSERT INTO t2 (message) VALUES ('Testing'),('table'),('t2');
mysql> CREATE TABLE total (
-> a INT NOT NULL AUTO_INCREMENT,
-> message CHAR(20), INDEX(a))
-> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;

The older term TYPE is supported as a synonym for ENGINE for backward compatibility, but ENGINE is the preferred term from MySQL 4.0.18 on and TYPE is deprecated.

Note that the a column is indexed as a PRIMARY KEY in the underlying MyISAM tables, but not in the MERGE table. There it is indexed but not as a PRIMARY KEY because a MERGE table cannot enforce uniqueness over the set of underlying tables.

In MySQL 4.1.23 and higher, when a table that is part of a MERGE table is opened, the following checks are applied before opening each table. If any table fails the conformance checks, then the operation that triggered the opening of the table will fail. The conformance checks applied to each table are:

*

Table must have exactly the same amount of columns that MERGE table has.
*

Column order in the MERGE table must match the column order in the underlying tables.
*

Additionally, the specification for each column in the parent MERGE table and the underlying table are compared. For each column, MySQL checks:
o

Column type in the underlying table equals the column type of MERGE table.
o

Column length in the underlying table equals the column length of MERGE table.
o

Column of underlying table and column of MERGE table can be NULL.
*

Underlying table must have at least the same amount of keys that merge table has. The underlying table may have morekeys than the MERGE table, but cannot have less.
*

For each key:
o

Check if the key type of underlying table equals the key type of merge table.
o

Check if number of key parts (i.e. multiple columns within a compound key) in the underlying table key definition equals the number of key parts in merge table key definition.
o

For each key part:
+

Check if key part lengths are equal.
+

Check if key part types are equal.
+

Check if key part languages are equal.
+

Check if key part can be NULL.

After creating the MERGE table, you can issue queries that operate on the group of tables as a whole:

mysql> SELECT * FROM total;
+---+---------+
| a | message |
+---+---------+
| 1 | Testing |
| 2 | table |
| 3 | t1 |
| 1 | Testing |
| 2 | table |
| 3 | t2 |
+---+---------+

Cursos de MySQL en México, bases de datos, MySQL, sql, México
.....
© Copyright 2006 84000.com.mx Todos los derechos reservados.
Prohibida la reproducción total o parcial del sitio.

Cursos de MySQL en México, bases de datos, MySQL, sql, México, Cursos de MySQL en México, bases de datos, MySQL, sql, México, Cursos de MySQL en México, bases de datos, MySQL, sql, México, Cursos de MySQL en México, bases de datos, MySQL, sql, México, Cursos de MySQL en México, bases de datos, MySQL, sql, México, Cursos de MySQL en México, bases de datos, MySQL, sql, México, Cursos de MySQL en México, bases de datos, MySQL, sql, México, Cursos de MySQL en México, bases de datos, MySQL, sql, México, Cursos de MySQL en México, bases de datos, MySQL, sql, México, Cursos de MySQL en México, bases de datos, MySQL, sql, México