Nick ...

Much like you told the SQL engine to use an index (select * from
INDEX:V.testProperty ...), you need to explicitly use indexes from the
graph API, as follows:

*Java:*

OrientVertex result = g.getVertices( "V.testProperty", "
cbc6b219-9df3-44c5-90b2-ab7a6bd9bf7e" ).iterator().next();


*Gremlin:*
GremlinPipeline p = g.getVertices( "V.testProperty", "
cbc6b219-9df3-44c5-90b2-ab7a6bd9bf7e" )._()


I think you'll find that using indexes with the Java API is even faster
than the SQL query API.
- Craig -


On Mon, Jun 1, 2015 at 5:33 PM, Nick DeYoung <deyoung.n...@gmail.com> wrote:

> I have an orient db 2.0.10 community server up and running
> I have created a simple test where I have placed 300,000 vertices in an
> orient database each with a property "testProperty" with a value -
> UUID.randomUUID().toString
> I have created an index on the property
>
>   graph.createKeyIndex("testProperty", classOf[Vertex])  // this is scala
> :)
>
> In a  test I create an OrientGraph connected via remote:
> 127.0.0.1:2424/test-database
>
> and do
>
> g.query().has("testProperty", "cbc6b219-9df3-44c5-90b2-ab7a6bd9bf7e")
>
> This takes 20 seconds to return the vertex with that UUID.
>
> In another test I do
>
> g.getRawGraph.query(new OSQLSynchQuery[ODocument]("select * from
> INDEX:V.testProperty where key = 'cbc6b219-9df3-44c5-90b2-ab7a6bd9bf7e'"))
>
> which takes 1 millisecond to return the vertex.
>
> Is the java graph query api really this slow or am I doing something
> wrong?
>
>
>
>
>
>
>
>
>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to orient-database+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to