mysql数据库如何优化?谁能给出点具体的解决方案?

mysql数据库如何优化?谁能给出点具体的解决方案?

第1个回答  2021-02-24
1、explain:解释sql的执行计划,后边的sql不执行
2、explain partitions :用于查看存在分区的表的执行计划
3、explain extended:待验证
4、show warnings:
5、show create table:查看表的详细的创建语句,便于用户对表进行优化
6、show indexes :产看表的所有索引,show indexes from table_name,同样也可以从information_schema.statistics表中获得同样的信息。cardinality列很重要,表示数据量。
7、show tables status: 查看数据库表的底层大小以及表结构,同样可以从information_schema.tables表中获得底层表的信息。
8、show [global|session]status:可以查看mysql服务器当前内部状态信息。可以帮助却行mysql服务器的负载的各种指标。默认是session。同information_schema.global_status和information_schema.session_status
9、show [global|session] variables :查看当前mysql系统变量的值,其中一些值能影响到sql语句的执行方式。同information_schema.global_variables和information_schema.session_variables;
10、information_schema:包含的表的数量和mysql的版本有关系。
相似回答