mysql 索引

1) 全文索引 (MyISAM存储引擎)

  select * from tablename where match(field) against('text'); ----使用模糊查询 默认空格分割

2) 外健索引 (Innodb存储引擎)

 

show variables like '%slow%'  -->log slow queries   ---设置记录长查询语句开关未开

show variables like '%long%'  -->log query time      ---设置长查询的时间

show variables like '%profiling%'   --->性能

show variables like '%cache%'   --->query cache type//////////////query cache size   ----》set global query_cache_size=0, 关闭缓存

show status like '%qcache%' ---> 缓存的命中率

 

打开: set global log_slow_queries =on;  临时生效

更改long query time; set long_query_time=0.5 (秒)

打开profiling:  set profiling=ON;

执行查询语句后--》执行 show profiles; (查找执行时间长的语句)---》show profile for query (前一个的query_id)

 

posted on 2019-01-22 11:32  xiaoliwm  阅读(62)  评论(0编辑  收藏  举报

导航