在ArangoDb Cluster上进行两次FULLTEXT搜索:涉及V8

时间:2018-05-23 19:40:00

标签: arangodb

我正在调查ArangoDb集群并发现在使用情况下两个FULLTEXT()搜索其中一个涉及V8引擎。 我的数据:

ContentTemplate

最简单的查询:

[
{
"TITL": "Attacks induced by bromocryptin in Parkinson patients",
"WORD": [
        "hascites",
        "Six patients with Parkinson's disease"
         ],
"ID":1,
},
{
"TITL": "Linear modeling of possible mechanisms for Parkinson tremor generation",
"WORD": [
        "hascites",
        "jsubsetIM"
         ],
"ID":2,
},
{
"TITL": "Drug-induced parkinsonism in the rat- a model for biochemical ...",
"WORD": [
        "hascites",
        "Following treatment with reserpine or alternatively with ...",
        "hasabstract"
        ],
"ID":3,
}
]

换句话说,我正在尝试查找FOR title IN FULLTEXT(pmshort,"TITL","parkinson") FOR word IN FULLTEXT(pmshort,"WORD","hascites") FILTER title.ID==word.ID RETURN title parkinsonTITL hascitesWORD的所有文档。这个例子被严格简化,所以使用像

这样的东西
FILTER word.WORD=='hascites'

是不可能的。需要两次或多次FULLTEXT搜索才能提供必要的功能。 收集包括约520,000个文件。在每个字段上设置FullText索引。

我发现每个单独运行的FULLTEXT查询都涉及索引:

Execution plan:
 Id   NodeType        Site         Est.   Comment
  1   SingletonNode   DBS             1   * ROOT
  5   IndexNode       DBS        526577     - FOR title IN pmshort   /* fulltext index scan */
  8   RemoteNode      COOR       526577       - REMOTE
  9   GatherNode      COOR       526577       - GATHER 
  4   ReturnNode      COOR       526577       - RETURN title

但是在使用的情况下FOR首先由V8(JavaScript)处理并且在协调器上运行,而不是DBS:

Execution plan:
 Id   NodeType            Site           Est.   Comment
  1   SingletonNode       COOR              1   * ROOT
  2   CalculationNode     COOR              1     - LET #2 = FULLTEXT(pmshort   /* all collection documents */, "TITL", "parkinson")   /* v8 expression */
  3   EnumerateListNode   COOR            100     - FOR title IN #2   /* list iteration */
 10   ScatterNode         COOR            100       - SCATTER
 11   RemoteNode          DBS             100       - REMOTE
  9   IndexNode           DBS        52657700       - FOR word IN pmshort   /* fulltext index scan */
  6   CalculationNode     DBS        52657700         - LET #6 = (title.`ID` == word.`ID`)   /* simple expression */   /* collections used: word : pmshort */
  7   FilterNode          DBS        52657700         - FILTER #6
 12   RemoteNode          COOR       52657700         - REMOTE
 13   GatherNode          COOR       52657700         - GATHER 
  8   ReturnNode          COOR       52657700         - RETURN title

当然,这会减慢系统的速度。 所以我的问题是: 1.为什么ArangoDb集群不能在DBS上处理这两个条件,而不能在协调器(COOR)上处理? 2.如何避免这种情况,因为性能下降300-500倍? 3.可能有人可以指出一些额外的材料来阅读这个。

感谢任何帮助。 谢谢!

2 个答案:

答案 0 :(得分:2)

在每个查询/子查询中应用了一个全文转换之后,查询优化器似乎停止寻找进一步的全文改进。

可以在Tag EC2 Instances & EBS Volumes on Creation | AWS News Blog(目标3.3.10)中找到对此的潜在解决方法。

答案 1 :(得分:0)

非常感谢! 它应该在3.3.10和未来3.4中提供,对吗?

相关问题