presto-docs/src/main/sphinx/connector/memory.rst
The Memory connector stores all data and metadata in RAM on workers and both are discarded when Presto restarts.
To configure the Memory connector, create a catalog properties file
etc/catalog/memory.properties with the following contents:
.. code-block:: none
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 memory.default.nation AS
SELECT * from tpch.tiny.nation;
Insert data into a table in the Memory connector::
INSERT INTO memory.default.nation
SELECT * FROM tpch.tiny.nation;
Select from the Memory connector::
SELECT * FROM memory.default.nation;
Drop table::
DROP TABLE memory.default.nation;
The Memory connector allows querying and creating tables and schemas in memory. Here are some examples of the SQL operations supported:
CREATE SCHEMA ^^^^^^^^^^^^^
Create a new schema named default1:
.. code-block:: sql
CREATE SCHEMA memory.default1;
CREATE TABLE ^^^^^^^^^^^^
Create a new table named my_table in the default1 schema:
.. code-block:: sql
CREATE TABLE memory.default1.my_table (id integer, name varchar, age integer);
INSERT INTO ^^^^^^^^^^^
Insert data into the my_table table:
.. code-block:: sql
INSERT INTO memory.default1.my_table (id, name, age) VALUES (1, 'John Doe', 30);
SELECT ^^^^^^
Select data from the my_table table:
.. code-block:: sql
SELECT * FROM memory.default1.my_table;
DROP TABLE ^^^^^^^^^^
To delete an existing table:
.. code-block:: sql
DROP TABLE memory.default.nation;
.. note:: After using DROP TABLE, memory is not released immediately. It is released after the next write access to the memory connector.
ALTER VIEW ^^^^^^^^^^
Alter view operations to alter the name of an existing view to a new name is supported in the Memory connector.
.. code-block:: sql
ALTER VIEW memory.default.nation RENAME TO memory.default.new_nation;
The following SQL statements are not supported:
/sql/alter-table/sql/delete/sql/updateLimitations ^^^^^^^^^^^