title: Spring Data neo4j bad performance in getting data from Neo4j database
body: <p>I am trying to make a simple query to get the 1st depth relationships for a particular node. I ran a couple tests to check the time taken for spring to get the data. The time taken is around 1.2 seconds even though the number of returned objects is 1 or 1000.</p>
  
  <p>Just to verify this behavior, I wrote a simple python script and executed the same query only to see that it takes just 40 ms to fetch the result.</p>
  
  <p>Could you please help me overcome this problem in Spring ? Thanks for your time.</p>
  
  <p>Entity - </p>
  
  <pre><code>@NodeEntity(label = "Person")
  public class Person {
  
      @Id
      @GeneratedValue
      private Long id;
  
      private String name;
  
      @Relationship(type="X",direction = Relationship.OUTGOING)
      private Set&lt;Person&gt; x;
  
      public Person()
      {}
  
      public Person(String name) {
          this.name = name;   
      }
  
      public String getName() {
          return name;
      }
  }
  </code></pre>
  
  <p>Repository - </p>
  
  <pre><code>import org.springframework.data.neo4j.annotation.Query;
  public interface PersonRepository extends CrudRepository&lt;Person, Long&gt; {
  
      @Query("match (n:Person)-[]-&gt;(k:Person) where n.name = {name} return k.name limit 1;")
      List&lt;String&gt; findPeople(String name);
  }
  </code></pre>
  
  <p>findPeople is taking 1 seconds overall to get one object back from the database .</p>