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.
CREATE TABLE products(title text, price float) morphology='stem_en';
Query OK, 0 rows affected (0.00 sec)
POST /cli -d "CREATE TABLE products(title text, price float) morphology='stem_en'"
{
"total":0,
"error":"",
"warning":""
}
$index = new \Manticoresearch\Index($client);
$index->setName('products');
$index->create([
'title'=>['type'=>'text'],
'price'=>['type'=>'float'],
]);
'CREATE TABLE forum(title text, price float)') utilsApi.sql(
= await utilsApi.sql('CREATE TABLE forum(title text, price float)'); res
sql("CREATE TABLE forum(title text, price float)"); utilsApi.
table products {
type = rt
path = tbl
rt_field = title
rt_attr_uint = price
stored_fields = title
}
ALTER
command as described in Change schema online.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)