0
votes

Hypothetically I have two collections.

users (document type)and relations (edge type)

Relations collection has two attributes {user1, user2} and is indexed combined.

My following query is extremely slow:

FOR r in relations filter (r.user1 == 'xyz' && r.user2 == 'abc') || (r.user1 == 'abc' && r.user2 == 'xyz') RETURN r

With 800 users and 5000 relationship it takes 35 seconds.

1
Can you provide the index definition here? - stj
Indexing wasn't proper. After the proper indexing it'f performant - Deepak Agarwal
You should post your solution as answer and accept it. - CodeManX
@DeepakAgarwal : It would be nice if you could post your solution as CoDEmanX suggested - 13abylon
@DeepakAgarwal can you also mark your own answer as 'accepted'? ;-) - dothebart

1 Answers

3
votes

I didn't create the indexes properly before. I recreated the indexes again and then the performance was improved.