【发布时间】:2020-12-22 22:46:47
【问题描述】:
我在vinylengine(磁盘)中创建了一个表,如何将其转换为memtxengine(ram)?
我有一些小桌子,如果将其转换为 memtx 会更好:
WITH x AS ( -- big table that wont fit in memory
SELECT cat_id, click_count FROM bla WHERE user_id = ?
), mx AS (
SELECT MAX(click_count) max_click FROM x
)
SELECT IFNULL(x.click_count,0)/IFNULL((SELECT max_click FROM mx),1)
, listings.*
FROM listings -- a small table less than 100k records which better in memory
LEFT JOIN x
ON listings.cat_id = x.cat_id
ORDER BY 1 DESC
LIMIT 10
但是目前listings 表是vinyl 表,如何在memtx 中转换呢?
尝试在documentation 中查找,除了create 中与引擎相关的box.space 中没有其他方法。
如果有办法重命名旧表,请使用适当的引擎创建一个新空间,从旧表插入,然后删除旧表。
【问题讨论】:
标签: tarantool