The
BLACKHOLE
Storage Engine
1319
the master host a “dummy” slave process whose default storage engine is
BLACKHOLE
, depicted as
follows:
The master writes to its binary log. The “dummy”
mysqld
process acts as a slave, applying the desired
combination of
replicate-do-*
and
replicate-ignore-*
rules, and writes a new, filtered binary
log of its own. (See
Section 16.1.2, “Replication and Binary Logging Options and Variables”
.) This
filtered log is provided to the slave.
The dummy process does not actually store any data, so there is little processing overhead incurred
by running the additional
mysqld
process on the replication master host. This type of setup can be
repeated with additional replication slaves.
INSERT
triggers for
BLACKHOLE
tables work as expected. However, because the
BLACKHOLE
table
does not actually store any data,
UPDATE
and
DELETE
triggers are not activated: The
FOR EACH ROW
clause in the trigger definition does not apply because there are no rows.
Other possible uses for the
BLACKHOLE
storage engine include:
• Verification of dump file syntax.
• Measurement of the overhead from binary logging, by comparing performance using
BLACKHOLE
with and without binary logging enabled.
•
BLACKHOLE
is essentially a “no-op” storage engine, so it could be used for finding performance
bottlenecks not related to the storage engine itself.
Blackhole Engine and Auto Increment Columns
The Blackhole engine is a no-op engine. Any operations performed on a table using Blackhole will have
no effect. This should be born in mind when considering the behavior of primary key columns that auto
increment. The engine will not automatically increment field values, and does not retain auto increment
field state. This has important implications in replication.
Consider the following replication scenario where all three of the following conditions apply:
1. On a master server there is a blackhole table with an auto increment field that is a primary key.
2. On a slave the same table exists but using the MyISAM engine.
3. Inserts are performed into the master's table without explicitly setting the auto increment value in
the
INSERT
statement itself or through using a
SET INSERT_ID
statement.
In this scenario replication will fail with a duplicate entry error on the primary key column.
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...