title: Why is using a parameterized query to insert data into a table faster than appending the values to the query string?
body: <p>Why is using a parameterized query to insert data into a table:</p>
  
  <pre><code>string queryString = "insert into product(id, name) values (@id, @name)";
  </code></pre>
  
  <p>faster than appending the values to the query string:</p>
  
  <pre><code>string queryString = "insert into product(id, name) values (" + _id + ", " + _name + ")";
  </code></pre>
  
  <p>?</p>
  
  <p>When I use the command in a loop to insert 10K rows, the parameterized query is an order of magnitude faster than the other one.</p>
  
  <p>I know a parametrized query has security and maintainability benefits, and it's the recommended way to use, but now I'm interested in an explanation on why is it that much faster?</p>