title: Does a UNIQUE constraint automatically create an INDEX on the field(s)?
body: <p>Should I <strong>define a separate index</strong> on the <code>email</code> column (for searching purposes), or is the index is "automatically" added along with <code>UNIQ_EMAIL_USER</code> constraint?</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `customer` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `user_id` int(11) NOT NULL,
    `first` varchar(255) NOT NULL,
    `last` varchar(255) NOT NULL,
    `slug` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `created_at` datetime NOT NULL,
    `updated_at` datetime NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `UNIQ_SLUG` (`slug`),
    UNIQUE KEY `UNIQ_EMAIL_USER` (`email`,`user_id`),
    KEY `IDX_USER` (`user_id`)
  ) ENGINE=InnoDB;
  </code></pre>
  
  <p><strong>EDIT</strong>: as suggested by Corbin i queried for <code>EXPLAIN SELECT * FROM customer WHERE email = 'address'</code> on empty table. This is the result, i don't know how to interpret it:</p>
  
  <pre><code>id select_type type possible_keys key  key_len ref  rows Extra
  1  SIMPLE      ALL  NULL          NULL NULL    NULL 1    Using where
  </code></pre>
  
  <p>While adding an IXD_EMAIL to the table the same query shows:</p>
  
  <pre><code>id select_type type possible_keys key       key_len ref   rows Extra
  1  SIMPLE      ref  IDX_EMAIL     IDX_EMAIL 257     const 1    Using where
  </code></pre>