Arangodb对AQL的反应缓慢
当我这样做嵌套查询时Arangodb对AQL的反应缓慢,arangodb,Arangodb,当我这样做嵌套查询时 FOR f in friends FOR l in locations FILTER l.friends_id == f.id RETURN {'friends':f, 'locations':l} (3484项结果) 响应缓慢(7到10秒之间),通过web界面和arangosh返回结果 我担心:这个响应时间不是太长吗?生产数据库将远远大于此,并可能带来性能问题 有什么想法吗? 问候 我尝试了以下方法: arangosh [_system]> db
FOR f in friends
FOR l in locations
FILTER l.friends_id == f.id
RETURN {'friends':f, 'locations':l}
(3484项结果)
响应缓慢(7到10秒之间),通过web界面和arangosh返回结果
我担心:这个响应时间不是太长吗?生产数据库将远远大于此,并可能带来性能问题
有什么想法吗?
问候 我尝试了以下方法:
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”并重试?现在快了吗?没有索引“朋友id”!执行“ensureHashIndex”后,问题已解决,谢谢!