为什么Delete表数据,磁盘空间却还是被占用
648
2022-11-07
Mysql精华问答(五)| explain 进行Sql分析
{EXPLAIN | DESCRIBE | DESC} tbl_name [col_name | wild]{EXPLAIN | DESCRIBE | DESC} [explain_type] {explainable_stmt | FOR CONNECTION connection_id}explain_type: { EXTENDED | PARTITIONS | FORMAT = format_name}format_name: { TRADITIONAL | JSON}explainable_stmt: { SELECT statement | DELETE statement | INSERT statement | REPLACE statement | UPDATE statement}
explain select * from test1 t1 inner join test1 t2 on t1.id=t2.id
结果:
explain select * from test1 t1 where t1.id = (select id from test1 t2 where t2.id=2);
结果:
explain select t1.* from test1 t1inner join (select max(id) mid from test1 group by id) t2on t1.id=t2.mid
结果:
explain select * from test1;
结果:
explain select * from test1 t1 where t1.id = (select id from test1 t2 where t2.id=2);
结果:
explainselect t1.* from test1 t1inner join (select max(id) mid from test1 group by id) t2on t1.id=t2.mid
结果:
explainselect * from test1unionselect* from test2
结果:
explain select * from test2 where id=1;
结果:
explain select * from test2 t1 inner join test2 t2 on t1.id=t2.id;
结果:
explain select * from test2 where code = '001';
结果:
explain select * from test1 t1 inner join test1 t2 on t1.id=t2.id where t1.code='001';
来源 | 捡田螺的小男孩
发表评论
暂时没有评论,来抢沙发吧~