OrientDB提取计划

时间:2018-07-05 10:31:19

标签: java memory orientdb

我在OrientDB 2.2.35中的fetchplan有问题

我的情况如下:我有一个带有2个顶点类的图:ridClasstokenClass,它们通过轻量级边连接,如下所示: ridClass->tokenClass->ridClass 在我的程序中,我想从ridClass的一个顶点开始,并且要遍历tokenClass的所有连接的顶点,并从这些顶点遍历到ridClass的所有连接的顶点。我使用SQL查找起始顶点(ridClass)和GremlinPipeline遍历图形。

我为每个cpu内核启动一个新线程,因此在我的情况下,我启动了4个线程。在每个线程中,它看起来像这样:

GremlinPipeline pipe = new GremlinPipeline();
OrientDynaElementIterable orientDynaElementIterable = graph.command(new OCommandSQL("select from #18:" + String.valueOf(indexPosition) + " fetchplan ridClass:3")).execute();
pipe.start(orientDynaElementIterable);
pipe.out();
List<Vertex> currentTokenList = pipe.toList();
for (Vertex currentToken : currentTokenList) {
    GremlinPipeline pipe2 = new GremlinPipeline();
    pipe2.start(currentToken);
    pipe2.out();
    List<Vertex> currentRIDList = pipe2.toList();
    for (Vertex currentRidVertex : currentRIDList) {
        //here I do something with the vertices...
    }
}

从逻辑上我得到了正确的顶点,但是问题是fetchplan。如果我像上面代码中的fetchplan ridClass:3一样使用graph.command,则我的程序不会更快,但比未设置fetchplan时要慢一些。我以为这个fetchplan会与SQL查询一起返回tokenClass的所有所有连接顶点,并从这些下一个ridClass顶点返回到缓存中?缓存可能太多了还是我理解fetchplan错误?即使像这样fetchplan降低fetchplan ridClass:1的深度级别,我的程序也会变慢。

我的OrientDB配置如下所示(我的计算机具有8gb RAM):

<properties>
    <entry value="1" name="db.pool.min"/>
    <entry value="50" name="db.pool.max"/>
    <entry value="false" name="profiler.enabled"/>
    <entry value="6000" name="storage.diskCache.bufferSize"/>
    <entry value="false" name="storage.useWAL"/>
    <entry value="4000" name="hashTable.slitBucketsBuffer.length"/>
    <entry value="8" name="storage.diskCache.writeCachePart"/>
    <entry value="500" name="storage.record.lockTimeout"/>
    <entry value="notx_sync_repair" name="sql.graphConsistencyMode"/>
</properties>

也许有人对这个问题有个想法。

亲切的问候

Sedir Mohammed

0 个答案:

没有答案