Title: Optimize Queries Causing WP-Admin Not Loading
Last modified: June 26, 2020

---

# Optimize Queries Causing WP-Admin Not Loading

 *  Resolved [Pankaj Kumar](https://wordpress.org/support/users/mygadgetplanet/)
 * (@mygadgetplanet)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/optimize-queries-causing-wp-admin-not-loading/)
 * Hi,
 * Suddenly my website wp-admin was not loading but website was working fine. It
   looked like some DB issue, so I ran the “show processlist” command and saw few
   queries are the culprit.
 *     ```
       MariaDB [(none)]> show processlist;
       +--------+------------+-----------+------------+---------+------+---------------------------------+------------------------------------------------------------------------------------------------------+----------+
       | Id     | User       | Host      | db         | Command | Time | State                           | Info                                                                                                 | Progress |
       +--------+------------+-----------+------------+---------+------+---------------------------------+------------------------------------------------------------------------------------------------------+----------+
                 |    0.000 |
       | 566697 | jour_wp    | localhost | jour_wp    | Query   | 1130 | Waiting for table metadata lock | OPTIMIZE TABLE wp_comments                                                                           |    0.000 |
       | 566698 | jour_wp    | localhost | jour_wp    | Query   | 1130 | Waiting for table level lock    | OPTIMIZE TABLE wp_comments                                                                           |    0.000 |
       | 567014 | jour_wp    | localhost | jour_wp    | Query   | 1002 | Waiting for table metadata lock | SELECT comment_date_gmt FROM wp_comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC |    0.000 |
       | 567129 | jour_wp    | localhost | jour_wp    | Query   |  957 | Waiting for table metadata lock | SELECT comment_approved, COUNT( * ) AS total
       		FROM wp_comments
       		WHERE comment_post_ID = 22338
       		GR |    0.000 |
       ```
   
 * I moved the “rvg-optimize-database” outside of plugins directly to temporary 
   disable it. Then restarted the MySQL server, WP-Admin started loading fine but
   I see some optimize queries are stuck again.
 *     ```
       MariaDB [(none)]> show processlist;
       +-----+------------+-----------+----------------+---------+------+---------------------------------+---------------------------------------------------------------------------------------------------+----------+
       | Id  | User       | Host      | db             | Command | Time | State                           | Info                                                                                              | Progress |
       +-----+------------+-----------+----------------+---------+------+---------------------------------+---------------------------------------------------------------------------------------------------+----------+
       |   8 | jour_wp    | localhost | jour_wp        | Query   |  385 | Waiting for table metadata lock | OPTIMIZE TABLE wp_litespeed_avatar                                                                |    0.000 |
       |  19 | jour_wp    | localhost | jour_wp        | Query   |  385 | Waiting for table level lock    | OPTIMIZE TABLE wp_litespeed_avatar                                                                |    0.000 |
       |  86 | root       | localhost | NULL           | Query   |    0 | init                            | show processlist                                                                                  |    0.000 |
       | 720 | cyberpanel | localhost | cyberpanel     | Sleep   |   27 |                                 | NULL                                                                                              |    0.000 |
       | 855 | jour_wp    | localhost | jour_wp        | Query   |   47 | Waiting for table metadata lock | UPDATE <code>wp_litespeed_avatar</code> SET dateline=1593149359 WHERE md5='1d4ba19a941cd14f82be44d97d8e2fa3' |    0.000 |
       ```
   
 * It could be from the CRON Job? How do I fix this? My DB is around 150MB, so not
   so big. And I am on a VPS Linode server that I manage myself and load never goes
   above 0.75. So it’s not server being heavily loaded too.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [cageehv](https://wordpress.org/support/users/cageehv/)
 * (@cageehv)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/optimize-queries-causing-wp-admin-not-loading/#post-13038514)
 * Hey Pankaj,
 * Are you using the ‘LiteSpeed Cache for WordPress” plugin?
 * It seems like that is causing the problem…
 * peace,
    Rolf
 *  Thread Starter [Pankaj Kumar](https://wordpress.org/support/users/mygadgetplanet/)
 * (@mygadgetplanet)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/optimize-queries-causing-wp-admin-not-loading/#post-13039500)
 * Yes, I am using the LS Cache plugin. But, why would it run the Optimize query?
   Like, I said that after disabling the Optimize DB plugin, the issue got resolved.
 * If you have any pointers to confirm that it’s indeed LS Cache issue, let me know
   and I will raise it against them.
 *  Plugin Contributor [cageehv](https://wordpress.org/support/users/cageehv/)
 * (@cageehv)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/optimize-queries-causing-wp-admin-not-loading/#post-13042533)
 * Hey Pankaj,
 * What you can try is excluding the table wp_litespeed_avatar from optimisation(
   in the settings page of my plugin.
 * Let me know if that fixes the problem.
 * peace,
    Rolf

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Optimize Queries Causing WP-Admin Not Loading’ is closed to new replies.

 * ![](https://ps.w.org/rvg-optimize-database/assets/icon-256x256.png?rev=3350597)
 * [Optimize Database after Deleting Revisions](https://wordpress.org/plugins/rvg-optimize-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rvg-optimize-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rvg-optimize-database/)
 * [Active Topics](https://wordpress.org/support/plugin/rvg-optimize-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rvg-optimize-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rvg-optimize-database/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [cageehv](https://wordpress.org/support/users/cageehv/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/optimize-queries-causing-wp-admin-not-loading/#post-13042533)
 * Status: resolved