Home >Backend Development >PHP Tutorial >Optimize table lock table?

Optimize table lock table?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-09-13 09:00:192440browse

The mysql version is 5.6 and I use Alibaba Cloud's RDS. I read online before that the optimize table will lock the table. I tested it myself today and it is possible to perform update delete operations during the optimize table.
Excuse me why this is

Another question, how do you know whether a statement/command will lock the table? Is there any way to check the locked table

Reply content:

The mysql version is 5.6 and I use Alibaba Cloud's RDS. I read online before that the optimize table will lock the table. I tested it myself today. It is possible to perform update delete operations during the optimize table.
Excuse me why this is

Another question, how do you know whether a statement/command will lock the table? Is there any way to check the locked table

show OPEN TABLES where In_use > 0; This SQL statement can check which tables are currently locked
SHOW PROCESSLIST; You can check the currently executing SQL statement and execution status

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn