title: Taking too long to return results MySQL
body: <p>I am confused why do the server is taking too much time in execution of a following query:</p>
  
  <pre><code>SELECT tbl1.Column1 FROM Table1 AS tbl1 
  INNER JOIN Table2 AS tbl2 ON tbl2.Column4 = tbl1.Column1
  </code></pre>
  
  <p>It took about 20 minutes to return the results. MySQL config (my.ini) file looks like the following:</p>
  
  <pre><code>[mysql]
  
  # CLIENT #
  port                           = 3306
  socket                         = X:\wamp\bin\mysql\mysql5.5.8\data\mysql.sock
  
  [mysqld]
  
  # GENERAL #
  user                           = mysql
  default-storage-engine         = InnoDB
  socket                         = X:\wamp\bin\mysql\mysql5.5.8\data\mysql.sock
  pid-file                       = X:\wamp\bin\mysql\mysql5.5.8\data\mysql.pid
  
  # MyISAM #
  key-buffer-size                = 32M
  myisam-recover                 = FORCE,BACKUP
  
  # SAFETY #
  max-allowed-packet             = 16M
  max-connect-errors             = 1000000
  
  # DATA STORAGE #
  datadir                        = X:\wamp\bin\mysql\mysql5.5.8\data\
  
  # BINARY LOGGING #
  log-bin                        = X:\wamp\bin\mysql\mysql5.5.8\data\mysql-bin
  expire-logs-days               = 14
  sync-binlog                    = 1
  
  # CACHES AND LIMITS #
  tmp-table-size                 = 32M
  max-heap-table-size            = 32M
  query-cache-type               = 0
  query-cache-size               = 0
  max-connections                = 500
  thread-cache-size              = 50
  open-files-limit               = 65535
  table-definition-cache         = 4096
  table-open-cache               = 4096
  
  # INNODB #
  innodb-log-files-in-group      = 2
  innodb-log-file-size           = 128M
  innodb-flush-log-at-trx-commit = 1
  innodb-file-per-table          = 1
  innodb-buffer-pool-size        = 2G
  
  # LOGGING #
  log-error                      = X:\wamp\bin\mysql\mysql5.5.8\data\mysql-error.log
  log-queries-not-using-indexes  = 1
  slow-query-log                 = 1
  slow-query-log-file            = X:\wamp\bin\mysql\mysql5.5.8\data\mysql-slow.log
  </code></pre>
  
  <p>Both Tables have primary keys.</p>
  
  <p>Regards,</p>
  
  <p>F. Ahmed</p>
  
  <p>===============
  UPDATE:</p>
  
  <p>After running Explain with the above query i got following results.</p>
  
  <pre><code>ID  SelectType  Table   Type        Key key_len     rows    extra
  1   SIMPLE      tbl2    index       item_record_id  261     95361   Using index
  1   SIMPLE      tbl1    index       record_id       261     88474   Using where;        Using    index; Using join buffer
  </code></pre>