Arangodb 中的低性能查询
Slow performant query in Arangodb
假设我有两个 collection。
users (document type)
和
relations (edge type)
关系 collection 有两个属性 {user1, user2}
并且被索引组合。
我的以下查询非常慢:
FOR r in relations filter (r.user1 == 'xyz' && r.user2 == 'abc') || (r.user1 == 'abc' && r.user2 == 'xyz')
RETURN r
800 个用户和 5000 个关系需要 35 秒。
我之前没有正确创建索引。我再次重新创建了索引,然后性能得到了提高。
假设我有两个 collection。
users (document type)
和
relations (edge type)
关系 collection 有两个属性 {user1, user2}
并且被索引组合。
我的以下查询非常慢:
FOR r in relations filter (r.user1 == 'xyz' && r.user2 == 'abc') || (r.user1 == 'abc' && r.user2 == 'xyz')
RETURN r
800 个用户和 5000 个关系需要 35 秒。
我之前没有正确创建索引。我再次重新创建了索引,然后性能得到了提高。