3

UPDATE table1 SET col1='True'
This query takes more than 30 secs for about 6000 records. Why is it so slow?

gbn
  • 422,506
  • 82
  • 585
  • 676
Rajesh
  • 6,269
  • 5
  • 28
  • 23
  • Check if some other operation is blocking. It might simply be that some other process is holding a lock on the table, preventing you from updating. – R van Rijn Jan 23 '10 at 07:46
  • It may be useful to add a SHOW CREATE TABLE for this table to your question. It sounds a bit odd. Also are other queries/updates slow? If so it may be a database configuration issue. – Phil Wallach Jan 23 '10 at 07:54

1 Answers1

6

Do you have a trigger?

And see my answers here too: Why does an UPDATE take much longer than a SELECT?

Community
  • 1
  • 1
gbn
  • 422,506
  • 82
  • 585
  • 676
  • 1
    I had trigger, temporarily turning off the trigger did the magic. ALTER TABLE table1 DISABLE TRIGGER ALL UPDATE table1 SET Col1='True' ALTER TABLE table1 ENABLE TRIGGER ALL – Rajesh Jan 23 '10 at 08:19