I've created a table in vinyl
engine (disk), how can I convert it to memtx
engine (ram)?
I have some small table that would be better if it converted to memtx
for something like this:
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
but currently listings
table is a vinyl
table, how to convert it in memtx
?
tried to find in documentation, there's no other method other than create
in box.space
related to engine.
If there's a way to rename old table, create a new space with proper engine, insert from old table, then drop the old table.
You can do dump/restore with tarantool/dump
Or you may walk the whole space and copy it row by row
Or create a replica with changed engine