2014-07-16 3 views
2

을 느리게.Arangodb 응답

응답은 웹 인터페이스를 통해 반환 결과 (7 ~ 10 초 사이) 느리고

내 우려를 arangosh :이 응답 시간이 너무 큰가요? 프로덕션 데이터베이스는 그보다 훨씬 커질 것이고 성능 문제가 발생할 수 있습니다.

아이디어가 있으십니까? 감사합니다.

답변

2

나는 다음 시도했다 :

arangosh [_system]> db._create("users"); 
[ArangoCollection 1252513721, "users" (type document, status loaded)] 

arangosh [_system]> db._create("locations"); 
[ArangoCollection 1252644793, "locations" (type document, status loaded)] 

arangosh [_system]> db._query("FOR i IN 1 .. 10000 INSERT { 'id': i, 'name': 'Name' } INTO users").toArray() 
[ ] 

arangosh [_system]> db._query("FOR i IN 1 .. 10000 INSERT { 'friends_id': i, 'name': 'Name' } INTO locations").toArray() 
[ ] 

arangosh [_system]> db.locations.ensureHashIndex("friends_id") 

var a = db._query("FOR f IN users FOR l IN locations FILTER l.friends_id == f.id RETURN { 'u': f, 'l': l}") 

이 매우 빠른 1000 개 개의 레코드를 반환합니다.

"ensureHashIndex"를 실행하고 다시 시도 할 수 있습니까? 이제 더 빨라 졌습니까?

+0

"friend_id"에 대한 색인이 생성되지 않았습니다. "ensureHashIndex"를 실행 한 후 문제가 해결되었습니다. 감사합니다! – Tarsis