title: MySQL update query extremely slow with indexes
body: <p>This query takes a lot of time to execute:</p>
  
  <pre><code>UPDATE facturacion2013_full a, facturacion2013_contadores b SET a.B1 = b.consumo WHERE a.contador = b.contador
  </code></pre>
  
  <p>Here my table structure:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `facturacion2013_full` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `poliza` int(8) NOT NULL,
    `contador` varchar(12) NOT NULL,
    `B1` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `fields_idx` (`contador`),
    KEY `fields_iidx2` (`poliza`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;
  
  CREATE TABLE IF NOT EXISTS `facturacion2013_contadores` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `poliza` int(8) NOT NULL,
    `contador` varchar(12) NOT NULL,
    `consumo` int(8) NOT NULL,
    PRIMARY KEY (`id`),
    KEY `idx1` (`contador`),
    KEY `idx2` (`poliza`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1  ;
  </code></pre>
  
  <p>I've tried changing little things with no luck. Also tried to change some parameters in the mysql config like buffer size, max_heap_table_size... What am I missing? Thanks in advance!</p>