title: OrientDB GraphDatabase: OSQLSynchQuery for @RID to get graph.getVertex(rid) ... the fastest way to load a vertex from index key?
body: <p>Given a basic Blueprints-compatible OrientGraph with Index 'name' (unique or notunique), any suggestions for how the following could be improved, if needs be?</p>
  
  <p>Note: I can't find a definitive guide to load a [blueprints] vertex using index. I have a large graph and using has('name','bob') (in console) takes 2 minutes!  On the other hand, an index-based search returns in milliseconds.</p>
  
  <p>The best I've come up with so far:</p>
  
  <pre><code>OrientGraph graph = new OrientGraph("local:/graph1/databases/test", "admin", "admin");
  List&lt;ODocument&gt; resultlist = graph.getRawGraph().query(new OSQLSynchQuery&lt;ODocument&gt;("SELECT FROM INDEX:name WHERE KEY = 'bob'"));
  ODocument resultodoc = resultlist.get(0).field("rid");
  String rid = resultodoc.getIdentity().toString();  // would return something like #6:1500000
  Vertex v1 = graph.getVertex(rid);
  System.out.println(v1.getProperty("name"));
  </code></pre>