data: optimize memory of sqlite database

* use sqlite "VACUUM" after analysis to reduce memory size
* only add filename to name of local symbol
This commit is contained in:
Eberhard Graether
2016-05-31 15:49:12 +02:00
parent da01855b68
commit ab43d309cb
7 changed files with 27 additions and 3 deletions
+12
View File
@@ -361,6 +361,18 @@ std::vector<StorageEdge> SqliteStorage::getEdgesByTargetType(Id targetId, int ty
return getAll<StorageEdge>("WHERE target_node_id == " + std::to_string(targetId) + " AND type == " + std::to_string(type));
}
void SqliteStorage::optimizeMemory() const
{
try
{
m_database.execDML("VACUUM;");
}
catch(CppSQLite3Exception e)
{
LOG_ERROR(e.errorMessage());
}
}
void SqliteStorage::optimizeFTSTable() const
{
try