1

I was running a simple query in MySQL, joining two tables and getting where it doesn't match. Both tables have 500k data. my query was something like

select count(*) from t1 join t2 t1.id <> t2.id

and after 300 seconds I got following error

Error Code: 1317. Query execution was interrupted

after that, I could not run a simple query on that table, like

select * from t1 limit 50

but all other tables were working and my system also got down for a while. Finally, I restarted my MySQL server then everything started working.

Any idea why my table got stuck??

TIA

6
  • t1.id <> t2.id ?? Not equal?? Commented Jun 9, 2020 at 15:04
  • I think that means you are joining each row in T1 with ALL BUT ONE row in T2. Making a HUGEMUNGOUS set of data Commented Jun 9, 2020 at 15:05
  • I was trying to get unmatched data from the table. I understand that because of my query execution was interrupted. But why my table got locked? Commented Jun 9, 2020 at 15:33
  • 1
    ok, I understand that my table got locked and I have to unlock the table, but I have encountered that error multiple times but the table never got locked. May be expensive query caused that. Thanks for your co-operation. Commented Jun 9, 2020 at 15:38
  • 1
    Really depends upon what the query was doing when the crash occured as to whether is will crash a table or not Commented Jun 9, 2020 at 15:39

1 Answer 1

2

Your table was locked, if a query crash for some reason, you have to kill your query to unlock you table (or restart your mysql server)

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.