1
vote
1answer
273 views

When tables are locked does MySQL queue queries?

I have a small production website, but it's live 24/7. When running the Optimize, Analyze or Repair commands, MySQL locks the table it is working on. QUESTIONS How would this effect users trying ...
0
votes
1answer
308 views

How to query-and-increase a value (counter) in a thread-safe way? (avoid race conditions)

In a table where each row has a counter (just an integer value), I need to get the current value and increase it at the same time. Effectively, I want to do this: SELECT counter FROM table WHERE ...
0
votes
1answer
118 views

Lock time not involved in MySQL slow query selection?

I wish to analyze some read-write contentions problems on a very huge table where writes are very fast, less than 1ms in most case. The point is that the contention makes those write queries sometimes ...
0
votes
2answers
102 views

Should we explicitly lock MyISAM tables or is it implicit…?

Does MyISAM tables automatically lock a table for each select or insert statement .... I mean if I query the database as select * from tablename then does the MySQL engine first lock it for read ...
2
votes
1answer
652 views

mysql “Lock wait timeout exceeded” two transaction with different keys indexed

I have set of tables that I need to delete their records with a specific key and insert new records. Different transactions are used one for each key: Transaction 1: DELETE FROM table1 WHERE id=1; ...
0
votes
1answer
126 views

When and how would MyISAM concurrent insert = always be a problem?

I wish to set concurrent_insert to always on a MyISAM log table, so that inserts wouldn't have to wait for selects to perform when there are some holes in the table. We're talking about 10-20 inserts ...
0
votes
1answer
1k views

mysql is locked; can't kill query

I have a mediawiki running on my local machine and just started running mysqldump last night: $ mysqldump -h localhost -u wikiuser --default-character-set=UTF8 wikidb --add-locks ...
1
vote
1answer
718 views

MySQL - Export two columns from large table without causing a lock

I am a sysadmin who doesn't do a ton of dba stuff. For a project, I have access to a production server--which I am not the sysadmin for--with an enormous 40,000,000 row >10 GB MySQL InnoDB table. I ...
0
votes
1answer
130 views

How do I stop a query from running if the row is locked?

I have a section of code that locks the database, updates it and then confirms. This is all working fine, if another user attempts to update the same row they cannot and their changes are discarded. ...
1
vote
2answers
1k views

jdbc+mysql: “Deadlock found when trying to get lock; try restarting transaction”

After recovering from a disk-full problem, I started getting these errors in my logs: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction at ...