Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I own a WordPress installation, and Updated to 3.4.1.

After the upgrade, I experienced a very strange slow-down.

After all, I used the

define('SAVEQUERIES', true);

in my wp-config.php with combined with the following code in my theme footer.php

global $wpdb;
echo "<pre>";
print_r($wpdb->queries);
echo "</pre>";

and I found that while I don't have many queries (49 queries I got), there are

  • 4 Queries took more than 9''
  • 3 Queries took more than 8''
  • 4 Queries took more than 7''
  • 4 Queries took more than 6''
  • 8 Queries took more than 5''
  • 1 Query took more than 4''

Here I will show you some of the queries:

/* Execution time 7.0095062E-5 */
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') AND tt.count > 0 ORDER BY t.name ASC

/* Execution time 5.3167343E-5 */
SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (77375,77379,77381)

/* Execution time 9.2029572E-5 */
SELECT wp_posts.* FROM wp_posts WHERE ID IN (77381,77379,77375)

In most of the queries, the query is simple, with no complexity. I cannot imagine why the queries are so slow.

The WordPress database contains in about 60,000 records and running on Percona-Server.

Any ideas for for what the issue might be, and how I could fix it ?

share|improve this question
1  
I would recommend adding EXPLAIN to your queries and posting the output to the question. –  Derek Downey Jul 20 '12 at 16:44
1  
When you did your upgrade, did that include an upgrade of Percona-Server as well ??? Did the upgrade affect your my.cnf file ??? –  RolandoMySQLDBA Jul 20 '12 at 16:49
    
@RolandoMySQLDBA, the update was software based only. I mean only the wordpress files updated, nor Percona server nor my.cnf –  Merianos Nikos Jul 20 '12 at 16:54
1  
Were you using Percona-Server before the WordPress upgrade ??? –  RolandoMySQLDBA Jul 20 '12 at 17:10
1  
Are all your tables InnoDB, MyISAM, or a combination of both ??? –  RolandoMySQLDBA Jul 20 '12 at 17:17
add comment

1 Answer 1

up vote 4 down vote accepted

Take a look the queries in your question

/* Execution time 7.0095062E-5 */
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') AND tt.count > 0 ORDER BY t.name ASC

/* Execution time 5.3167343E-5 */
SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (77375,77379,77381)

/* Execution time 9.2029572E-5 */
SELECT wp_posts.* FROM wp_posts WHERE ID IN (77381,77379,77375)

Look at the execution time above each query

  • 7.0095062E-5 is .000070095062 seconds
  • 5.3167343E-5 is .000053167343 seconds
  • 9.2029572E-5 is .000092029572 seconds

The SQL queries themselves are fast.

Please read any release notes on WordPress 3.4.1 to see if WordPress upgrade installed any DB-related modules that need tuning or deactivation. Also, check for any data that was added during the upgrade process that may have bloated your tables.

share|improve this answer
    
Thanks a lot for your assistance !! –  Merianos Nikos Jul 21 '12 at 15:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.