This article is half-done without your Comment! *** Please share your thoughts via Comment ***
Have you ever wished that you do not want to insert any data, but want to execute INSERT command ?
This is looking like a very strange requirement, but this is possible in MySQL.
MySQL has a BLACKHOLE Storage Engine which we can use for the empty or the dummy INSERT on Table.
When we created a BLACKHOLE table, It creates with only .frm table format file and It has no any other file associated with it.
When you execute your INSERT on BLACKHOLE Table, It stores only binary log and It does not store any kind of data.
When we should use BLACKHOLE Storage Engine?
When we require to measure the performance only on the binary logging process. Mostly we require to test binary logging performance for bulk operations.
When we require to find performance bottlenecks not related to disk-storage.
When we require slave-side data validation and filtering, we can create a dummy BLACKHOLE table at the master-side which reduces the overall traffic.
Check the status of BLACKHOLE Engine:
1 |
SHOW ENGINES; |
Create BLACKHOLE table:
1 2 3 4 5 |
CREATE TABLE tbl_Students ( RNO INT NOT NULL ,StudName VARCHAR(20) NOT NULL )ENGINE = BLACKHOLE; |
Try to insert few records:
1 2 3 4 |
INSERT INTO tbl_Students VALUES (1,'Anvesh'),(2,'Neevan') ,(3,'Jeeny'),(4,'Roy'); |
Check inserted data, which return Empty Set:
1 2 |
SELECT *FROM tbl_Students; Empty set (0.00 sec) |