Index creation speed is too slow

I’m creating indexes for an Edge class containing about 500 million records on keys (in, out). The index creation progressed well in the beginning at about 20,000 items/sec. But then after some time has decreased to <1000 items/sec.

2019-05-08 08:43:25:885 INFO  {db=cgraph} --> 37.00% progress, 177,405,476 indexed so far (855 items/sec) [OIndexRebuildOutputListener]
2019-05-08 08:43:35:899 INFO  {db=cgraph} --> 37.00% progress, 177,415,347 indexed so far (987 items/sec) [OIndexRebuildOutputListener] 
2019-05-08 08:43:45:902 INFO  {db=cgraph} --> 37.00% progress, 177,427,464 indexed so far (1,211 items/sec) [OIndexRebuildOutputListener]

At this speed, it’ll take like 3-4 days!!
Settings used on 16GB RAM and 300GB SSD
java -server -Xms2G -Xmx7G -Dstorage.diskCache.bufferSize=7200

Any idea why the speed of indexing decreased so drastically? And how can I increase the speed of indexing?

Hi @suhassumukh

which version of OrientDB are you using?

Hi @suhassumukh

which kind of index did you use?

HASH_INDEX o or SBTREE?

Hi there

I would start from RAM tuning (xmx=800m)

https://orientdb.com/docs/2.1.x/Performance-Tuning.html