title: Neo4j very slow when executing query through PHP but very fast through webadmin
body: <p>I have the following problem.
  I have written a query:</p>
  
  <pre><code>  MATCH (n:RealNode {gid:'58687'})-[:CONTAINS*..15]-(z) RETURN DISTINCT ID(z), z.id,n.id as InternalID
  </code></pre>
  
  <p>which I run through a PHP script (by sending a POST request). It takes ages to get a response and sometimes neo4j hangs.
  I tried the same query in the Neo4j webadmin and I get the response in ms.</p>
  
  <p>Any idea why in the first case the response takes so much time?</p>
  
  <p><strong>EDITED</strong>
  This the request using CURL:</p>
  
  <pre><code>   $obj_id = $_POST['datastr'];
     $dataArr = array("query" =&gt; "MATCH (n {gid:'$obj_id'})-[:CONTAINS*..15]-(z) RETURN DISTINCT ID(z), z.id,n.id as InternalID");
  
    $data = json_encode($dataArr);
    $curl=curl_init();
    curl_setopt($curl,CURLOPT_HTTPHEADER,array('Accept: application/json; charset=UTF-8','Content-Type: application/json','Content-Length: ' . strlen($data),'X-Stream: true'));
    curl_setopt($curl, CURLOPT_URL, 'http://localhost:7474/db/data/cypher/');  
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); //type of request   
    curl_setopt($curl, CURLOPT_POSTFIELDS,$data); // data to post
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // return response as string
    $response = curl_exec($curl);
    echo $response;
    curl_close($curl);
  </code></pre>