title: Best way to delete all nodes and relationships in Cypher
body: <p>What is the best way to cleanup the graph from all nodes and relationships via Cypher?</p>
  
  <p>At <a href="http://neo4j.com/docs/stable/query-delete.html#delete-delete-a-node-and-connected-relationships" rel="noreferrer">http://neo4j.com/docs/stable/query-delete.html#delete-delete-a-node-and-connected-relationships</a> the example</p>
  
  <pre><code>MATCH (n)
  OPTIONAL MATCH (n)-[r]-()
  DELETE n,r
  </code></pre>
  
  <p>has the note:</p>
  
  <blockquote>
    <p>This query isn’t for deleting large amounts of data</p>
  </blockquote>
  
  <p>So, is the following better?</p>
  
  <pre><code>MATCH ()-[r]-() DELETE r
  </code></pre>
  
  <p>and</p>
  
  <pre><code>MATCH (n) DELETE n
  </code></pre>
  
  <p>Or is there another way that is better for large graphs?</p>