# From time to time very slow UPDATE

**URL:** https://forums.percona.com/t/from-time-to-time-very-slow-update/258
**Category:** Other MySQL® Questions
**Created:** [March 23, 2007, 11:53am UTC](https://forums.percona.com/t/from-time-to-time-very-slow-update/258 "2007-03-23T11:53:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![4matic](https://avatars.discourse-cdn.com/v4/letter/4/b3f665/32.png) [@4matic](https://forums.percona.com/u/4matic)
#### Post date: [March 23, 2007, 11:53am UTC](https://forums.percona.com/t/from-time-to-time-very-slow-update/258/1 "2007-03-23T11:53:26Z")

</div>

I have a system:  
Windows XP SP2  
MySQL 5.0.27  
PHP 5.2.0 (mysqli ext)

CREATE TABLE `parts` ( `partid` int(10) unsigned NOT NULL auto\_increment, `oenumsearch` char(30) NOT NULL, `tmid` smallint(5) unsigned NOT NULL default ‘0’, `oenum` char(35) NOT NULL, `isset` smallint(5) unsigned default ‘0’, `numtypeid` smallint(5) unsigned default ‘0’, `textid` int(10) unsigned default NULL, `texts` char(255) default NULL, `isttx` tinyint(1) unsigned NOT NULL default ‘0’, `isimg` tinyint(1) unsigned NOT NULL default ‘0’, `isauto` tinyint(1) unsigned NOT NULL default ‘0’, `remarks` char(255) default NULL, PRIMARY KEY (`partid`), KEY `tmid` (`tmid`), KEY `oenums` (`oenumsearch`,`tmid`), KEY `oenumsearch` (`oenumsearch`), KEY `isset` (`isset`), KEY `numtypeid` (`numtypeid`), KEY `textid` (`textid`) ) ENGINE=InnoDB

I start transaction and update some tables. One of the updated tables is `parts`. When start query:

UPDATE `parts` SET `textid`=1471, `texts`=“Some text” WHERE `partid`=47437

Database is stuck, and query executed about 300-400 seconds. In this time I cant start another query. Another query is wait while ends query for update.  
This stuks is happend form time to time. Only one client sends query, thats means database is not busy.

Where looking for problem? I dont uderstand what to do. Help me, please.

P.S. Sorry for my dreadful English, my native language is PHP ).

---

<div class="post-metadata">

### Author: ![Speeple](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Speeple](https://forums.percona.com/u/Speeple)
#### Post date: [March 25, 2007, 9:31am UTC](https://forums.percona.com/t/from-time-to-time-very-slow-update/258/2 "2007-03-25T09:31:28Z")

</div>

How many rows does this table have?

You have a quite a few indexes which will slow down updates.

Also note that KEY `oenumsearch` (`oenumsearch`) is a redundent index. Key lookups on the column oenumsearch can happily be performed on the KEY `oenums` (`oenumsearch`,`tmid`) index.

---

<div class="post-metadata">

### Author: ![4matic](https://avatars.discourse-cdn.com/v4/letter/4/b3f665/32.png) [@4matic](https://forums.percona.com/u/4matic)
#### Post date: [March 26, 2007, 1:50am UTC](https://forums.percona.com/t/from-time-to-time-very-slow-update/258/3 "2007-03-26T01:50:49Z")

</div>

| [B]Quote:[/B] |
| Also note that KEY `oenumsearch` (`oenumsearch`) is a redundent index. Key lookups on the column oenumsearch can happily be performed on the KEY `oenums` (`oenumsearch`,`tmid`) index. |

Thanks. I will drop this index. I knew this, but I did this for sure.

| [B]Quote:[/B] |
| How many rows does this table have? |

About 7 000 000 and still growing. It will stop about 20 000 000 rows.

| [B]Quote:[/B] |
| You have a quite a few indexes which will slow down updates |

I understand, that indexes is slow down updates. I dont understand, why one update fast, another update - slow?
