Trim/truncate frames in a database

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Trim/truncate frames in a database

matlabbe
Administrator
This post was updated on .
Here is an example of completely removing frames in a database. This would work for removing frames at the end or at the beginning of the map. Removing all frames after 1054:
$ sqlite3 map.db "delete from Link where from_id>=1055 or to_id>=1055"
$ sqlite3 map.db "delete from Node where id>=1055"
$ sqlite3 map.db "delete from Data where id>=1055"
$ sqlite3 map.db "delete from Feature where node_id>=1055"
$ sqlite3 map.db "delete from Word where id in (select id from Word left join Feature on id=word_id where node_id is null)"

Note that this hasn't been tested with a new mapping session continuing from this database, where the vocabulary may have words from deleted signatures. By removing word references in Feature table, this should be ok though. For visualization/export, this should work.

cheers,
Mathieu

Reply | Threaded
Open this post in threaded view
|

Re: Trim/truncate frames in a database

matlabbe
Administrator
Got
 
"[ WARN] (2017-12-11 15:36:58.971) Memory.cpp:316::loadDataFromDb() _vwd->getUnusedWordsSize() must be empty... size=8286"
for unreferenced words in the vocabulary. I edited the answer above with the following:
$ sqlite3 map.db "delete from Word where id in (select id from Word left join Feature on id=word_id where node_id is null)"
then the warning disappeared when reloading the database for mapping.