title: Deleting rows using LINQ To SQL is extremely slow on Windows Phone 7.1
body: <p>There is Windows Phone 7 app using SQL CE database. I need to delete 1000-2000 rows. There is no other choice than using LINQ To SQL on Windows Phone 7 Mango - SQL CE database.</p>
  
  <p>What I do is extremaly simple (pseudocode):</p>
  
  <pre><code>Entity[] tmp = null;
  do
  {
      tmp = datacontext.mytable.Where( ...expression here ...).Take(200).ToArray();
      if (temp.Length &gt; 0)
      {
          mytable.DeleteAllOnSubmit(tmp);
          datacontext.SubmitChanges();
      }
  } while (temp.Length &gt; 0);
  </code></pre>
  
  <p>The problem is that deleting 200 rows takes 7 seconds! All time is taken inside <code>datacontext.SubmitChanges()</code>.</p>
  
  <p>Is there any way to make it faster?  </p>
  
  <p>Any option to use 'batch delete'? ('batch_insert' would be also welcome)</p>
  
  <p>A few technical details:</p>
  
  <ul>
  <li>DataContext was created by SqlMetal tool and it looks rather heavy. </li>
  <li>Entity has 2 foreign key relations.</li>
  </ul>