I have a MySQL Cluster database where the data is both in-memory and written to disk.
I'm trying to understand the
ALTER ONLINE TABLE ... STORAGE MEMORY statement, so that I can use this technique to minimize DDL operations downtime.
The documentation does not clarify my doubts.
I have a table like this
CREATE TABLE `mytable` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=ndbcluster AUTO_INCREMENT=103 DEFAULT CHARSET=utf8
I'm adding a new field to the table with the
ONLINE schema change
ALTER ONLINE TABLE `mytable` ADD `myfield` INT STORAGE MEMORY;
Query is successful, the new field exists and is correctly writable for all nodes.
If I ask the table schema to mysql
SHOW CREATE TABLE `mytable`;
CREATE TABLE `mytable` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(255) NOT NULL, `myfield` int(11) /*!50606 STORAGE MEMORY */ DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=ndbcluster AUTO_INCREMENT=103 DEFAULT CHARSET=utf8
So what I understand is that I have a table that is written to disk but has one field that is not. Am I right?
Is this field and its contents saved with the MySQL Cluster Backup system?
If the Cluster globally dies, I'm going to loose the field and its content?