title: EF SaveChanges running too slow
body: <p>I'm trying to insert about 2000-5000 records with 60 fields with EF6 MVC.</p>
  
  <p>This is my code :</p>
  
  <pre><code>using (var db = new MyEntities())
  {
      using (var transaction = db.Database.BeginTransaction(System.Data.IsolationLevel.Serializable))
      {
          try
          {
              db.Database.CommandTimeout = 180;
  
              // ToInsertStatement is an ExtensionMethod
              // which generates a sql INSERT statement from list of entities
              // in *N* batch size.
              // INSERT INTO tbl values(),()*N*(); INSERT INTO...
              db.Database.ExecuteSqlCommand(entitiesList.ToInsertStatement(20));
  
              // Some other changes
              db.SaveChanges();
              transaction.Commit();
          }
          catch (Exception exception)
          {
              transaction.Rollback();
          }
      }
  }
  </code></pre>
  
  <p>According to Admir's <a href="https://stackoverflow.com/a/15632717/2624611">answer</a>, I send every 20 records with one INSERT statement and fortunately <code>ExecuteSqlCommand</code> takes only 6 seconds. BUT <code>SaveChanges()</code> takes about 2 minutes!</p>
  
  <p><strong>How can I overcome this problem?</strong></p>