I tried the example given here after some minor changes - basically I added the where clause without matching - for an experimental purpose.
On my system (1.9.M04 - java 6u43 - ubuntu 12.04 - AMD phenom II -X6 1090T) a simple request
Only 1 node in the database (also built-in) took 262 ms. Obviously, something is going wrong. What could be the problem?
thank
public void test()
{
GraphDatabaseService db = g = new GraphDatabaseFactory().newEmbeddedDatabase("./neo4j1test" );
long id;
Transaction tx = db.beginTx();
try
{
Node refNode = db.createNode();
id = refNode.getId();
refNode.setProperty( "name", "reference node" );
tx.success();
}
finally
{
tx.finish();
}
ExecutionEngine engine = new ExecutionEngine( db );
ExecutionResult result = engine.execute( "start n=node("+id+") where ( n.name = \"reference node\") return n.name" );
long time = System.currentTimeMillis();
result = engine.execute( "start n=node("+id+") where ( n.name = \"reference node\") return n.name" );
time = (System.currentTimeMillis() - time);
System.out.println("Time taken : " + time + " ms.");
}
source
share