Increasing creation time for new types/clusters, if an index is defined
See original GitHub issueIn the context of a converter from SQL to graph database, I benchmarked the creation of new types in OrientDB. Strangely, when an index is defined, the time spent for creating new types/clusters increases linearly (approximately) over time.
My benchmark performs the following steps, using the Java API with OrientDB 2.1rc4:
add 2 string properties to V (someProperty1, someProperty2)
for 1 to 10 do
insert 10 new types
insert 10000 vertices
endfor
Concretely, in each iteration I measure only the time spent to create the 10 new types, in three different case:
- no index
- one index defined for someProperty1
- one index defined for someProperty1 and one index defined for someProperty2
It appears that the time spent for creating new types is constant if no indices are defined. However, with an index, the creation time increases linearly to the number of existing types. If we increase the number of indices, the creation time seems to increase linearly as well.
The problem occurs with SB-Tree and Hash indices, unique or not unique. It occurs as well when the clusters are empty (no vertex insertion). Intuitively, I suspect a problem related to index allocation or index rebalacing.
Here is the quick&dirty code I runned for the benchmark: http://benjaminbillet.fr/media/OrientDBDatabaseBenchmarks.java
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (7 by maintainers)
Top GitHub Comments
Fixed in 2.2 version
Problem of this bug is that we require to flush disk cache in case of class\cluster\index creation. Recently we decided to postpone change which allows to prevent force flush of data which in turn will fix this bug. So I postpone this change to next version.