docs/src/main/sphinx/connector/memory.md
The Memory connector stores all data and metadata in RAM on workers and both are discarded when Trino restarts.
To configure the Memory connector, create a catalog properties file
etc/catalog/example.properties with the following contents:
connector.name=memory
memory.max-data-per-node=128MB
memory.max-data-per-node defines memory limit for pages stored in this
connector per each node (default value is 128MB).
Create a table using the Memory connector:
CREATE TABLE example.default.nation AS
SELECT * from tpch.tiny.nation;
Insert data into a table in the Memory connector:
INSERT INTO example.default.nation
SELECT * FROM tpch.tiny.nation;
Select from the Memory connector:
SELECT * FROM example.default.nation;
Drop table:
DROP TABLE example.default.nation;
Create a table with a column that has a default value:
CREATE TABLE orders (
orderkey bigint,
status varchar DEFAULT 'created'
)
(memory-type-mapping)=
Trino supports all data types used within the Memory schemas so no mapping is required.
(memory-sql-support)=
The connector provides read and write access to temporary data and metadata
stored in memory. In addition to the {ref}globally available <sql-globally-available> and {ref}read operation <sql-read-operations>
statements, the connector supports the following features:
/sql/insert/sql/truncate/sql/create-table/sql/create-table-as/sql/drop-table/sql/alter-table/sql/create-schema/sql/drop-schema/sql/alter-schema/sql/commentUpon execution of a TRUNCATE and a DROP TABLE operation, memory is not released
immediately. It is instead released after the next write operation to the
catalog.
(memory-dynamic-filtering)=
The Memory connector supports the {doc}dynamic filtering </admin/dynamic-filtering> optimization.
Dynamic filters are pushed into local table scan on worker nodes for broadcast joins.
For the Memory connector, a table scan is delayed until the collection of dynamic filters.
This can be disabled by using the configuration property memory.enable-lazy-dynamic-filtering
in the catalog file.