Reputation: 1563
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
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