Real-time table

A Real-time table is a main type of table in Manticore, allowing you to add, update, and delete documents with immediate availability of the changes. The settings for a Real-time Table can be defined in a configuration file or online using CREATE/UPDATE/DELETE/ALTER commands.

A Real-time Table is comprised of one or multiple plain tables called chunks. There are two types of chunks:

The size of the RAM chunk is controlled by the rt_mem_limit setting. Once this limit is reached, the RAM chunk is flushed to disk in the form of a disk chunk. If there are too many disk chunks, they can be merged into one for better performance using the OPTIMIZE command or automatically.

Creating a real-time table via SQL protocol:
CREATE TABLE products(title text, price float) morphology='stem_en';
Query OK, 0 rows affected (0.00 sec)
Creating a real-time table via JSON over HTTP:
POST /cli -d "CREATE TABLE products(title text, price float)  morphology='stem_en'"
{
"total":0,
"error":"",
"warning":""
}
Creating a real-time table via PHP client:
$index = new \Manticoresearch\Index($client);
$index->setName('products');
$index->create([
    'title'=>['type'=>'text'],
    'price'=>['type'=>'float'],
]);
Python:
utilsApi.sql('CREATE TABLE forum(title text, price float)')
Javascript:
res = await utilsApi.sql('CREATE TABLE forum(title text, price float)');
Java:
utilsApi.sql("CREATE TABLE forum(title text, price float)");
Creating a real-time table via a configuration file:
table products {
  type = rt
  path = tbl
  rt_field = title
  rt_attr_uint = price
  stored_fields = title
}

👍 What you can do with a real-time table:

⛔ What you cannot do with a real-time table:

Real-time table files structure

The following table outlines the different file extensions and their respective descriptions in a real-time table:

Extension Description
.lock A lock file that ensures that only one process can access the table at a time.
.ram The RAM chunk of the table, stored in memory and used as an accumulator of changes.
.meta The headers of the real-time table that define its structure and settings.
.*.sp* Disk chunks that are stored on disk with the same format as plain tables. They are created when the RAM chunk size exceeds the rt_mem_limit.

For more information on the structure of disk chunks, refer to the plain table format)