mysql - Deleting rows cause lock timeout -
When I try to delete rows from the table, I get these errors. The special case here is that I can run 5 processes at the same time.
The table itself is an Inodb table with ~ 4.5 million rows. I do not have an index on the column used in the WHERE clause. I
This is being done within transition, before I delete the record, then include the changes in the records, and only if all If the records are included, the transaction should be reduced.
Error message:
query error: lock waiting timeout; Try restarting the transaction while executing Tablename WHERE column = value
from WTT Will it help to create an index on the referenced column? Should I explicitly lock the rows?
I have got some additional information in the question but I do not think that it covers my situation completely.
Is it certain that this is the DELETE statement that is causing the error, or can there be another statement in this query? DELETE statement is first, so it sounds logical but I'm not sure.
An index definitely helps if you are trying to change the deleted record Modify your query to use an update instead of a DELETE after an INSERT:
Enter in the table SET column2 = 'value2' at WHERE column = value Duplicate key update column 2 = 'value2'
Comments
Post a Comment