The
BLACKHOLE
Storage Engine
1318
mysql>
CREATE TABLE test (i INT NOT NULL, c CHAR(10) NOT NULL)
->
ENGINE = CSV;
Query OK, 0 rows affected (0.12 sec)
mysql>
INSERT INTO test VALUES(1,'record one'),(2,'record two');
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql>
SELECT * FROM test;
+------+------------+
| i | c |
+------+------------+
| 1 | record one |
| 2 | record two |
+------+------------+
2 rows in set (0.00 sec)
If you examine the
test.CSV
file in the database directory created by executing the preceding
statements, its contents should look like this:
"1","record one"
"2","record two"
This format can be read, and even written, by spreadsheet applications such as Microsoft Excel or
StarOffice Calc.
The
CSV
storage engine does not support indexing.
14.10. The
BLACKHOLE
Storage Engine
The
BLACKHOLE
storage engine acts as a “black hole” that accepts data but throws it away and does
not store it. Retrievals always return an empty result:
mysql>
CREATE TABLE test(i INT, c CHAR(10)) ENGINE = BLACKHOLE;
Query OK, 0 rows affected (0.03 sec)
mysql>
INSERT INTO test VALUES(1,'record one'),(2,'record two');
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql>
SELECT * FROM test;
Empty set (0.00 sec)
The
BLACKHOLE
storage engine is included in MySQL binary distributions. To enable this storage
engine if you build MySQL from source, invoke
configure
with the
--with-blackhole-storage-
engine
option.
To examine the source for the
BLACKHOLE
engine, look in the
sql
directory of a MySQL source
distribution.
When you create a
BLACKHOLE
table, the server creates a table format file in the database directory.
The file begins with the table name and has an
.frm
extension. There are no other files associated
with the table.
The
BLACKHOLE
storage engine supports all kinds of indexes. That is, you can include index
declarations in the table definition.
You can check whether the
BLACKHOLE
storage engine is available with this statement:
mysql>
SHOW VARIABLES LIKE 'have_blackhole_engine';
Inserts into a
BLACKHOLE
table do not store any data, but if the binary log is enabled, the SQL
statements are logged (and replicated to slave servers). This can be useful as a repeater or filter
mechanism. Suppose that your application requires slave-side filtering rules, but transferring all
binary log data to the slave first results in too much traffic. In such a case, it is possible to set up on
Содержание 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 ...