Title: Table keeps getting locked
Last modified: June 21, 2021

---

# Table keeps getting locked

 *  Resolved [roshans89](https://wordpress.org/support/users/roshans89/)
 * (@roshans89)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/table-keeps-getting-locked/)
 * Hello,
 * I have the following queries that keeps running (after loggin queries)
 * `ALTER TABLE`pool_wp_scorehistory_s1_t1`CHANGE`ranking_idranking_id`INT UNSIGNED
   NOT NULL, CHANGE`score_orderscore_order`INT UNSIGNED NOT NULL DEFAULT '0', CHANGE`
   typetype`TINYINT UNSIGNED NOT NULL DEFAULT '0', CHANGE`source_idsource_id`INT
   UNSIGNED NOT NULL, CHANGE`user_iduser_id`INT UNSIGNED NOT NULL, CHANGE`scorescore`
   INT UNSIGNED NOT NULL, CHANGE`fullfull`SMALLINT UNSIGNED NOT NULL DEFAULT '0',
   CHANGE`totototo`SMALLINT UNSIGNED NOT NULL DEFAULT '0', CHANGE`goal_bonusgoal_bonus`
   SMALLINT UNSIGNED NOT NULL DEFAULT '0', CHANGE`goal_diff_bonusgoal_diff_bonus`
   SMALLINT UNSIGNED NOT NULL DEFAULT '0', CHANGE`total_scoretotal_score`INT UNSIGNED
   NOT NULL DEFAULT '0', CHANGE`rankingranking` INT UNSIGNED NOT NULL
 * CREATE TABLE IF NOT EXISTS `pool_wp_scorehistory_s1_t1` ( `ranking_id` int(10)
   unsigned NOT NULL, `score_order` int(10) unsigned NOT NULL DEFAULT ‘0’, `type`
   tinyin`
 * See Image:
 * [https://ibb.co/47hLKk6](https://ibb.co/47hLKk6)
 * I have disabled all caches. The website becomes unresponsive. Any way to prevent
   this from running / any codes I can comment?
 * Thanks
    Roshan
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftable-keeps-getting-locked%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [roshans89](https://wordpress.org/support/users/roshans89/)
 * (@roshans89)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/table-keeps-getting-locked/#post-14579817)
 * I commented all sql queries in data/install.txt and data/updateXX.txt
 * It seems to be OK
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/table-keeps-getting-locked/#post-14579987)
 * These ALTER TABLE queries are triggered by a plugin update. The “ALTER TABLE”
   is from the v2.7.0 upgrade. Did you recently update from a lower version to the
   latest version (v2.9.5)? Or are these transactions older?
 * If there is a lot of data in the scorehistory table, it is possible that your
   database server has trouble updating columns or indexes on the columns. If this
   is the case, then for future updates I would recommend to clean these tables 
   first, then do the update and finally do a re-calc to fill the scorehistory again.
 * It’s hard to tell what the current state of the database is. But when the update
   has not finished correctly, then you will eventually run into trouble because
   the code does not match with the database definition.
 * My advice for next steps are first to try to create a backup of your database,
   then kill all these transactions and finally check your database definition. 
   An easy way for this would be to export all “pool_wp_” tables to an SQL file 
   and compare it to an SQL dump of a clean install of the plugin (install it somewhere
   else). Any differences should be easy to spot with a textual compare (e.g. in
   notepad++ or any other tool for this). When you know the differences, you can
   manually update your database definition. You may need some professional guidance
   if you do not have a lot of database experience.
 *  Thread Starter [roshans89](https://wordpress.org/support/users/roshans89/)
 * (@roshans89)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/table-keeps-getting-locked/#post-14580364)
 * Yes I updated from World Cup 2018 to this one.
    It is not able to update and 
   create index because it already exists. The issue is that it keeps trying and
   it locks the table. It spawned almost 800 processes. My whole website was down.
 * I solved the issued by deleting all sql queries in data/install.txt and data/
   update-XXX.txt
 * Thanks
    Roshan
    -  This reply was modified 4 years, 10 months ago by [roshans89](https://wordpress.org/support/users/roshans89/).
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/table-keeps-getting-locked/#post-14580655)
 * But if you commented out all queries, then your database is not updated. And 
   you miss some correct indexes on the tables, which will mean you miss the positive
   impact they bring on performance, and you’ll generate errors/warnings because
   the bonus questions table misses a column.
 * If you send me a dump of your table structure (no data) I can help you to create
   an update script that you can run directly in your database.
 *  Thread Starter [roshans89](https://wordpress.org/support/users/roshans89/)
 * (@roshans89)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/table-keeps-getting-locked/#post-14586356)
 * Apparently the changes were already made. Really strange. That’s why I keep getting
   those errors on the index creation – because it already exists.
    It works fine–
   no worries. Thanks a lot.
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/table-keeps-getting-locked/#post-14586559)
 * Okay, thanks for letting me know. Marking this as resolved.

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

The topic ‘Table keeps getting locked’ is closed to new replies.

 * ![](https://ps.w.org/football-pool/assets/icon-256x256.png?rev=983880)
 * [Football Pool](https://wordpress.org/plugins/football-pool/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/football-pool/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/football-pool/)
 * [Active Topics](https://wordpress.org/support/plugin/football-pool/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/football-pool/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/football-pool/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [AntoineH](https://wordpress.org/support/users/antoineh/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/table-keeps-getting-locked/#post-14586559)
 * Status: resolved