title: MySQL SELECT from INFORMATION_SCHEMA.COLUMNS taking > 1 minute
body: <p>Here's my query:</p>
  
  <pre><code>SELECT COLUMN_NAME 
  FROM INFORMATION_SCHEMA.COLUMNS 
  WHERE TABLE_NAME = "transactions" 
  </code></pre>
  
  <p>And here is how long it took:</p>
  
  <pre><code>Showing rows 0 - 29 ( 36 total, Query took 61.8934 sec)
  </code></pre>
  
  <p>I'm no dba but this isn't normal, is it?  Should it be my expectation that querying INFORMATION_SCHEMA should take over a minute?  Is there anything I'm doing wrong here?  Do I need to add an index or something in order to get normal response out of this?  </p>
  
  <p>--- Edit to address questions</p>
  
  <p>Version 5.5.30-30.2</p>
  
  <p>This db is hosted by HostGator</p>
  
  <p>EXPLAIN SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "transactions"</p>
  
  <pre><code>id  select_type     table   type    possible_keys   key     key_len     ref     rows    Extra
  1   SIMPLE  COLUMNS     ALL     NULL    TABLE_NAME  NULL    NULL    NULL    Using where; Open_frm_only; Scanned 1 database
  </code></pre>
  
  <p>SHOW CREATE TABLE transactions:</p>
  
  <pre><code>transactions    CREATE TABLE `transactions` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `accountId` int(11) NOT NULL DEFAULT '0',
   `contractId` int(11) NOT NULL DEFAULT '0',
   `insertionId` int(11) NOT NULL DEFAULT '0',
   `aNetCIMProfileId` int(11) NOT NULL DEFAULT '0',
   `paymentProfileId` int(11) NOT NULL DEFAULT '0',
   `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `wasSuccessful` tinyint(1) NOT NULL DEFAULT '0',
   `amount` int(11) NOT NULL DEFAULT '0',
   `resultText` varchar(255) NOT NULL,
   `authNetTransactionId` bigint(20) NOT NULL DEFAULT '0',
   `isChargedBack` tinyint(1) NOT NULL DEFAULT '0',
   PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=latin1
  </code></pre>
  
  <hr>
  
  <pre><code>SELECT Count( * )
  FROM INFORMATION_SCHEMA.COLUMNS
  </code></pre>
  
  <p>[This also took > 1 minute]</p>
  
  <blockquote>
    <p>1303</p>
  </blockquote>
  
  <pre><code>SELECT COLUMN_NAME 
  FROM INFORMATION_SCHEMA.COLUMNS 
  WHERE TABLE_NAME = "transactions" 
      AND TABLE_SCHEMA = 'mydbname'
  </code></pre>
  
  <p>Same response time</p>
  
  <pre><code>SET global innodb_stats_on_metadata = 0;
  #1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation
  </code></pre>
  
  <p>(This db is hosted by HostGator)</p>