I learned that OrientDB would allow me to store edges to other documents and thus would not need join statements. I created the appropriate indices, tested this, and noticed the following:
Is there a way to force the use of indices in those queries?
OrientDB support mainly indexes on basic properties like you said it works well on the top level fields of document, anyway it does support as well indexes for collections of simple types, like for example a java List<String>
.
It is possible to use indexes to traverse graph relationship but is a bit convoluted, because you need to create indexes for the whole set of structures of the path, for example a condition :
out('Friend').name="John"
to use index, it need indexes on the whole path like:
create index vertex_out_friend on vertex(out_friend) not_unique;
create index friend_out on Friend(out) not_unique;
create index vertex_name on vertex(name) not_unque;
vertex
== stand as the vertex class of your vertex
Friend
== stand as the edge class of your edge
I hope this help