OrientDB SQL 与 Gremlin

OrientDB SQL vs Gremlin

OrientDB 中哪种查询语言提供最快的解决方案:SQL 还是 Gremlin? Gremlin 非常有吸引力,因为它对其他图形库是通用的,但是这是否需要在 OrientDB 或 none 中进行大量翻译(延迟是多少)?

编辑 正如@decebal 指出的那样,这不是一个好的测试用例场景。 请丢弃以下基准。

power of a graph database comes from relationships, those queries are obviously biased towards simple structures which reflects the only conclusion that when you want simple data structures you are better of using documents rather than graphs... can't compare apples with pears

========

我 运行 进行了一些测试,SQL 明显更快。 我使用的代码:

long startTime = System.currentTimeMillis();

// Object ret = orientGraph.command(new OCommandGremlin("g.v('9:68128').both().both()")).execute();
String oSqlCommand = "SELECT expand(out().out()) FROM V where user_id='9935'";
Object ret = orientGraph.command(new OCommandSQL(oSqlCommand)).execute();
Iterable<Vertex> vertices = (Iterable<Vertex>) ret;

long endTime = System.currentTimeMillis();
long operationTime = endTime - startTime;
System.out.println("Operation took " + operationTime + " ms");

我只是 wikitalk 数据集。 Gremlin 命令花费了大约 42541 秒,而 SQL 命令平均只花费了 1831 毫秒。

在 Linux Debian 64 位 VM 4GB 内存、1024MB 堆、2048MB 磁盘缓存上进行了 运行 测试。