title: MySQL "set unique_checks", "set foreign_key_checks" vs. "alter table disable keys"
body: <p>We're having a problem where a mysqldump script is spending 90% of it's time populating a small handful of the tables it deals with.  Eliminating FK's and indexes eliminates the speed problem, but is not an acceptable solution.</p>
  
  <p>The dump script <strong>does</strong> have:</p>
  
  <pre><code>/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  </code></pre>
  
  <p>Can we expect any different behavior from <code>ALTER TABLE foo DISABLE KEYS</code>?</p>
  
  <p>Also, is <code>disable keys</code>   session-scoped  or is it permanent until I re-enable it?  Can I disable keys from one mysql session and have it effect the import issued from another session?</p>