cat pants
cat pants

Reputation: 1563

Is it possible to determine if a query in MySQL will lock a table?

In MySQL, is it possible to determine if a query will lock a table before running it? Versions of interest: 5.1, 5.5, 5.6. Storage engines of interest, if that matters: MyISAM and InnoDB.

Thanks!

Upvotes: 0

Views: 125

Answers (1)

Sam
Sam

Reputation: 2761

No. Hence you want a testing environment to run queries and see how they behave. Try to make the testing environment as close to production as possible. You can run EXPLAIN on a query and if it does not use indexes correctly chances are it is going to lock the table when you have a lot of records.

Upvotes: 2

Related Questions