logic: improved performance of storing index to database

* add compiled statement for batch inserting 100 occurrences at once
* removed unnecessary primary key from component_access to get rid of additional index table
* changed explicit check for existing symbols when injecting to implicit check in insert statement (insert or ignore)
* improved performance of adding edges by replacing edge multi part index with in-memory-index
* added in-memory-index for node table
* added in-memory-index for local_symbol table
* added in-memory-index for lource_location table
* moved setting storage mode to SqliteIndexStorage, because storage modes are not used anywhere else.
* don't store current mode as member because re-creating an existing index takes no time.
* add getter for name of SqliteDatabaseIndex
* removed unused method from persistent storage
This commit is contained in:
mlangkabel
2018-08-10 15:37:08 +02:00
parent 52d0236f9a
commit 337cf2d371
22 changed files with 262 additions and 265 deletions
+2 -4
View File
@@ -27,7 +27,7 @@ public:
Id addSourceLocation(const StorageSourceLocationData& data) override;
void addOccurrence(const StorageOccurrence& data) override;
void addOccurrences(const std::vector<StorageOccurrence>& occurrences) override;
void addComponentAccess(const StorageComponentAccessData& data) override;
void addComponentAccess(const StorageComponentAccess& componentAccess) override;
void addCommentLocation(const StorageCommentLocationData& data) override;
void addError(const StorageErrorData& data) override;
@@ -38,7 +38,7 @@ public:
void forEachLocalSymbol(std::function<void(const StorageLocalSymbol& /*data*/)> callback) const override;
void forEachSourceLocation(std::function<void(const StorageSourceLocation& /*data*/)> callback) const override;
void forEachOccurrence(std::function<void(const StorageOccurrence& /*data*/)> callback) const override;
void forEachComponentAccess(std::function<void(const StorageComponentAccessData& /*data*/)> callback) const override;
void forEachComponentAccess(std::function<void(const StorageComponentAccess& /*data*/)> callback) const override;
void forEachCommentLocation(std::function<void(const StorageCommentLocationData& /*data*/)> callback) const override;
void forEachError(std::function<void(const StorageErrorData& /*data*/)> callback) const override;
@@ -85,8 +85,6 @@ public:
NodeType getNodeTypeForNodeWithId(Id nodeId) const override;
Id getIdForEdge(
Edge::EdgeType type, const NameHierarchy& fromNameHierarchy, const NameHierarchy& toNameHierarchy) const override;
StorageEdge getEdgeById(Id edgeId) const override;
std::shared_ptr<SourceLocationCollection> getFullTextSearchLocations(