The Memory database engine keeps its metadata and table definitions only in memory. It is intended for temporary databases: the database and its tables are lost when the server stops or restarts.
Creating a database
CREATE DATABASE temporary_data
ENGINE = Memory;Usage
Create and use tables as in an Atomic database:
CREATE TABLE temporary_data.events
(
id UInt64,
name String
)
ENGINE = Memory;
INSERT INTO temporary_data.events VALUES (1, 'started');Do not use this engine for data or definitions that must survive a restart. Use Atomic, the default open-source database engine, for persistent database metadata.
See also
Syntax
ENGINE = MemoryRelated
Atomic