Alex Zhulin
Alex Zhulin

Reputation: 1305

Add new property in OrientDB class with big amount of records

I have a class (vertex) in my OrintDB with a big enough amount of records. Say 21 millions.

This class has two defined in schema properties (id and name). I've added this properties in order create indexes by this fields.

Other data (address, for example) stored in records in schema-less mode.

Now I have to search companies by address. This way I have to add new property "address" in order to create index by this property. But the problem is that property creation takes very long time.

Is there any way to improve speed of this process?

Upvotes: 0

Views: 125

Answers (1)

tglman
tglman

Reputation: 527

The reason why the create property is slow is because it has to check the all the data for be sure that is consistent with the new created property.

If you are 100% sure that the all the data is consistent you can skip this check using the unsafe keyword, ex: create property v.address String unsafe

But be aware if your data is not consistent and you run the create property with unsafe you may get errors later-on while the application is running, so use it carefully.

Upvotes: 1

Related Questions