Skip to content

Create Table

liuhuicong edited this page Feb 19, 2019 · 2 revisions

Create Table

CREATE TABLE `TestDB`.`test_table` (
  `userid` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `birthdate` DATE NOT NULL,
  `register_time` DATETIME NOT NULL,
  `user_desc` TEXT NOT NULL,
  PRIMARY KEY (`userid`),
  KEY `name_key` (`username`),
  FULLTEXT KEY `desc_key` (`user_desc`)
) ENGINE=Rocksdb DEFAULT CHARSET=gbk AVG_ROW_LENGTH=100 COMMENT='{"comment":"", "resource_tag":"", "namespace":"TEST_NAMESPACE"}';

After CREATE TABLE returns successfully, the synchronization of table schema from baikalMeta to baikaldb/baikalStore requires 10-30 seconds, during which SQL command like show tables and desc table may fail.