Bug #55517 Create variable defining default storage format for new NDB tables.
Submitted: 23 Jul 2010 15:58 Modified: 24 Jul 2010 15:39
Reporter: Matthew Montgomery Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S4 (Feature request)
Version:mysql-5.1-telco-7.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: ndb-7.1.6

[23 Jul 2010 15:58] Matthew Montgomery
Description:
Create global|session variable ndb_storage=MEMORY|DISK which CREATE TABLE... ENGINE=NDB observes when STORAGE clause is not provided. 

Currently CREATE TABLE uses TABLESPACE DEFAULT-TS provided by InitialTablespace when TABLESPACE is not otherwise specified.  We should also have an option to allow the operator to dictate that default storage format is DISK based so that all newly created tables are on-disk unless explicitly specified.

How to repeat:
mysql> SELECT TABLESPACE_NAME FROM information_schema.FILES WHERE FILE_TYPE='TABLESPACE';
+-----------------+
| TABLESPACE_NAME |
+-----------------+
| DEFAULT-TS      |
+-----------------+
1 row in set (0.01 sec)

mysql> set storage_engine=ndbcluster; 
Query OK, 0 rows affected (0.01 sec)

mysql> create table t1 (a int unsigned auto_increment primary key, b varchar(50)) STORAGE DISK ; 
Query OK, 0 rows affected (1.07 sec)
[21 Nov 2010 23:44] MySQL Verification Team
The implementation should be engine independent for those who may want to set a default STORAGE DISK or STORAGE MEMORY for the PBXT engine also as shown here:

http://www.fromdual.com/transactional-memory-resident-tables-with-pbxt

Perhaps storage_format=DISK|MEMORY would be better, instead of engine specific ndb_storage= as originally suggested.