0
votes

I have some serious performance problems using orientdb. I have got a plocal graph Database with a sheme like the following, the data is imported from JSON:

PersonA --hasInterest-> InterestA
PersonA --hasInterest-> InterestB
PersonB --hasInterest-> InterestA
PersonB --hasInterest-> InterestB

My goal is to find Interests that occur in combination with a given Interest. So my query looks like:

SELECT * FROM ( TRAVERSE out_hasInterest FROM ( SELECT FROM ( TRAVERSE in_hasInterest FROM #12:33 ) WHERE $depth > 0 )) WHERE $depth > 0

Where #12:33 is an Interest.

My real data is a bit bigger than this small snippet so for a concrete Interest there are ~500,000 Persons associated which have an average of ~3 Interests. So I would Traverse 500,000 + 500,000 * 3 = 2,000,000 Vertices. That seems not to be that much.

The query needs ~100 seconds. This is far to much for my application.

I think I am doing something terribly wrong, I can't believe the performance is that bad. Any help is greatly appreciated!

Best regards Ludwig


Version: 1.7-rc1

1

1 Answers

1
votes

Why are you using traverse? If I understand correctly your goal you could do:

SELECT expand( in('hasInterest').out('hasInterest') ) FROM #12:33