[英]Titan + Tinkerpop extremly slow read
My setup is: Java 1.7, Tinkerpop 2.6, Titan 0.5.3, Cassandra 2.1.2 and Easticsearch 1.4.2. 我的设置是:Java 1.7,Tinkerpop 2.6,Titan 0.5.3,Cassandra 2.1.2和Easticsearch 1.4.2。
My problem is that I have extremely slow reads. 我的问题是读取速度极慢。 In my test code I'm inserting only one Vertex with one property. 在我的测试代码中,我仅插入一个具有一个属性的顶点。 This takes 5 ms. 这需要5毫秒。 Then I try to read this Vertex again. 然后,我尝试再次阅读此“顶点”。 This takes 1500 ms. 这需要1500毫秒。 Why is the reading 300 times slower? 为什么读数慢300倍?
Any help is much appreciated. 任何帮助深表感谢。
long d1 = new Date().getTime();
String id = UUID.randomUUID().toString();
Vertex customer = g.addVertex();
customer.setProperty("somethingnew", id);
g.commit();
long d2 = new Date().getTime();
long d3 = 0;;
Iterable<Vertex> its = g.query().has("somethingnew", id).vertices();
for (Vertex vert : its) {
if (vert.getProperty("somethingnew").toString().equals(id)) {
d3 = new Date().getTime();
}
}
System.err.println( "Insert took [ms]:" + (d2 - d1));
System.err.println( "Read took [ms]:" + (d3 - d2));
您可能应该阅读有关索引的文章
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.