title: Slow running query in MySQL
body: <p>I've recently come across a query which is taking abnormally long time from past few days. We had a server migration for MySQL database last month, and the problem never happened on the previous server. The MySQL version on the older server was 5.1.34 and on current one it's 5.1.58(not sure if that could have anything to do with this issue).</p>
  
  <p>The query is as below:</p>
  
  <pre><code> SELECT table_name,
         partition_name,
         subpartition_name,
         partition_method,
         subpartition_method,
         partition_expression,
         subpartition_expression,
         partition_description,
         partition_comment,
         nodegroup,
         tablespace_name
  FROM   information_schema.partitions
  WHERE  table_schema LIKE 'wialogdb'
         AND NOT Isnull(partition_name)
         AND table_name LIKE 'freemail'
  ORDER  BY table_name,
            partition_name,
            partition_ordinal_position,
            subpartition_ordinal_position;  
  </code></pre>
  
  <p>It's query on information_schema.PARTITIONS 
  fired by Navicat to get the details about the table structure, it's very difucult to reproduce.</p>
  
  <p>when you edit the table Navicat has to collect all the details abotu the table from Information Schema
  (e.g lsit of Engines, Table Columns, see analyze Show Create table, etc)
  and PARTITIONS is one of the table it has to check as you can see the WHERE condition is not "correct" WHERE TABLE_SCHEMA LIKE 'wialogdb' it should not be LIKE it should be WHERE TABLE_SCHEMA = 'wialogdb', this query is much more faster, but it's Navicat's internal code
  we can not change it. we didn't have this issues in the past (old MySQL 5.1.34)</p>
  
  <p>Any help would be highly appreciated.</p>
  
  <p>Thanks in advance.</p>