| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> mysql >> MySQL shu ju ku zhong cha zhao zhi xing xiao lv man de SQL yu ju

MySQL shu ju ku zhong cha zhao zhi xing xiao lv man de SQL yu ju

2008-06-01 03:36:33 编辑來源:互联网 评论
 
 
 
本文为【MySQL数据库中查找执行效率慢的SQL语句】的拼音翻译版
  qi dong Mysql shi jia shen shu --log-slow-queries lai ji lu zhi xing shi jian chao guo long_query_time miao de sql:
  
  /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql
  --user=mysql --pid-file=/var/run/mysqld/mysqld.pid
  --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock --log-slow-
  queries=/var/log/mysql/slow.log
  explain lai le jie SQL zhi xing de zhuang tai 。
  explain select * from wp_posts\G;
  shi yong show status like "Handler_read%"; lai le jie suo yin de xiao guo 。
  Handler_read_key zhi gao biao shi suo yin xiao guo hao ,Handler_read_rnd_next zhi gao biao shi suo yin di xiao 。
  yong show processlist cha kan dang qian yun xing zhuang tai 。
  mysql> show processlist;
  +-----+-------------+--------------------+
  | Id | User | Host | db | Command | Time| State | Info
  +-----+-------------+--------------------+
  |207|root |192.168.0.20:51718 |mytest | Sleep | 5 | | NULL
  |208|root |192.168.0.20:51719 |mytest | Sleep | 5 | | NULL
  |220|root |192.168.0.20:51731 |mytest |Query | 84 | Locked |
  select bookname,culture,value,type from book where id=001
  xian jian dan shuo yi xia ge lie de han yi he yong tu , di yi lie ,id, bu yong shuo le ba , yi ge biao shi , ni yao kill yi ge yu ju de shi hou hen you yong 。user lie , xian shi dan qian yong hu , ru guo bu shi root, zhe ge ming ling jiu zhi xian shi ni quan xian fan wei nei de sql yu ju 。host lie , xian shi zhe ge yu ju shi cong na ge ip de na ge duan kou shang fa chu de 。 he he , ke yi yong lai zhui zong chu wen ti yu ju de yong hu 。db lie , xian shi zhe ge jin cheng mu qian lian jie de shi na ge shu ju ku 。command lie , xian shi dang qian lian jie de zhi xing de ming ling , yi ban jiu shi xiu mian (sleep), cha xun (query), lian jie (connect)。time lie , ci zhe ge zhuang tai chi xu de shi jian , dan wei shi miao 。state lie , xian shi shi yong dang qian lian jie de sql yu ju de zhuang tai , hen chong yao de lie , hou xu hui you suo you de zhuang tai de miao shu , qing zhu yi ,state zhi shi yu ju zhi xing zhong de mou yi ge zhuang tai , yi ge sql yu ju , yi cha xun wei li , ke neng xu yao jing guo copying to tmp table,Sorting result,Sending data deng zhuang tai cai ke yi wan cheng ,info lie , xian shi zhe ge sql yu ju , yin wei chang du you xian , suo yi chang de sql yu ju jiu xian shi bu quan , dan shi yi ge pan duan wen ti yu ju de chong yao yi ju 。
  zhe ge ming ling zhong zui guan jian de jiu shi state lie ,mysql lie chu de zhuang tai zhu yao you yi xia ji zhong :
  Checking table
  zheng zai jian cha shu ju biao ( zhe shi zi dong de )。
  Closing tables
  zheng zai jiang biao zhong xiu gai de shu ju shua xin dao ci pan zhong , tong shi zheng zai guan bi yi jing yong wan de biao 。 zhe shi yi ge hen kuai de cao zuo , ru guo bu shi zhe yang de hua , jiu ying gai que ren ci pan kong jian shi fou yi jing man le huo zhe ci pan shi fou zheng chu yu chong fu zhong 。
  Connect Out
  fu zhi cong fu wu qi zheng zai lian jie zhu fu wu qi 。
  Copying to tmp table on disk
  you yu lin shi jie guo ji da yu tmp_table_size, zheng zai jiang lin shi biao cong nei cun cun chu zhuan wei ci pan cun chu yi ci jie sheng nei cun 。
  Creating tmp table
  zheng zai chuang jian lin shi biao yi cun fang bu fen cha xun jie guo 。
  deleting from main table
  fu wu qi zheng zai zhi xing duo biao shan chu zhong de di yi bu fen , gang shan chu di yi ge biao 。
  deleting from reference tables
  fu wu qi zheng zai zhi xing duo biao shan chu zhong de di er bu fen , zheng zai shan chu qi ta biao de ji lu 。
  Flushing tables
  zheng zai zhi xing FLUSH TABLES, deng dai qi ta xian cheng guan bi shu ju biao 。
  Killed
  fa song le yi ge kill qing qiu gei mou xian cheng , na me zhe ge xian cheng jiang hui jian cha kill biao zhi wei , tong shi hui fang qi xia yi ge kill qing qiu 。MySQL hui zai mei ci de zhu xun huan zhong jian cha kill biao zhi wei , bu guo you xie qing kuang xia gai xian cheng ke neng hui guo yi xiao duan cai neng si diao 。 ru guo gai xian cheng cheng bei qi ta xian cheng suo zhu le , na me kill qing qiu hui zai suo shi fang shi ma shang sheng xiao 。
  Locked
  bei qi ta cha xun suo zhu le 。
  Sending data
  zheng zai chu li SELECT cha xun de ji lu , tong shi zheng zai ba jie guo fa song gei ke hu duan 。
  Sorting for group
  zheng zai wei GROUP BY zuo pai xu 。
  Sorting for order
  zheng zai wei ORDER BY zuo pai xu 。
  Opening tables
  zhe ge guo cheng ying gai hui hen kuai , chu fei shou dao qi ta yin su de gan rao 。 li ru , zai zhi ALTER TABLE huo LOCK TABLE yu ju xing wan yi qian , shu ju biao wu fa bei qi ta xian cheng da kai 。 zheng chang shi da kai yi ge biao 。
  Removing duplicates
  zheng zai zhi xing yi ge SELECT DISTINCT fang shi de cha xun , dan shi MySQL wu fa zai qian yi ge jie duan you hua diao na xie chong fu de ji lu 。 yin ci ,MySQL xu yao zai ci qu diao chong fu de ji lu , ran hou zai ba jie guo fa song gei ke hu duan 。
  Reopen table
  huo de le dui yi ge biao de suo , dan shi bi xu zai biao jie gou xiu gai zhi hou cai neng huo de zhe ge suo 。 yi jing shi fang suo , guan bi shu ju biao , zheng chang shi chong xin da kai shu ju biao 。
  Repair by sorting
  xiu fu zhi ling zheng zai pai xu yi chuang jian suo yin 。
  Repair with keycache
  xiu fu zhi ling zheng zai li yong suo yin huan cun yi ge yi ge di chuang jian xin suo yin 。 ta hui bi Repair by sorting man xie 。
  Searching rows for update
  zheng zai jiang fu he tiao jian de ji lu zhao chu lai yi bei geng xin 。 ta bi xu zai UPDATE yao xiu gai xiang guan de ji lu zhi qian jiu wan cheng le 。
  Sleeping
  zheng zai deng dai ke hu duan fa song xin qing qiu .
  System lock
  zheng zai deng dai qu de yi ge wai bu de xi tong suo 。 ru guo dang qian mei you yun xing duo ge mysqld fu wu qi tong shi qing qiu tong yi ge biao , na me ke yi tong guo zeng jia --skip-external-locking shen shu lai jin zhi wai bu xi tong suo 。
  Upgrading lock
  INSERT DELAYED zheng zai chang shi qu de yi ge suo biao yi cha ru xin ji lu 。
  Updating
  zheng zai sou suo pi pei de ji lu , bing qie xiu gai ta men 。
  User Lock
  zheng zai deng dai GET_LOCK()。
  Waiting for tables
  gai xian cheng de dao tong zhi , shu ju biao jie gou yi jing bei xiu gai le , xu yao chong xin da kai shu ju biao yi qu de xin de jie gou 。 ran hou , wei le neng de chong xin da kai shu ju biao , bi xu deng dao suo you qi ta xian cheng guan bi zhe ge biao 。 yi xia ji zhong qing kuang xia hui chan sheng zhe ge tong zhi :FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, huo OPTIMIZE TABLE。
  waiting for handler insert
  INSERT DELAYED yi jing chu li wan le suo you dai chu li de cha ru cao zuo , zheng zai deng dai xin de qing qiu 。
  da bu fen zhuang tai dui ying hen kuai de cao zuo , zhi yao you yi ge xian cheng bao chi tong yi ge zhuang tai hao ji miao zhong , na me ke neng shi you wen ti fa sheng le , xu yao jian cha yi xia 。
  huan you qi ta de zhuang tai mei zai shang mian zhong lie chu lai , bu guo ta men da bu fen zhi shi zai cha kan fu wu qi shi fou you cun zai cuo wu shi cai yong de zhe 。【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
qi dong Mysql shi jia shen shu --log-slow-queries lai ji lu zhi xing shi jian chao guo long_query_time miao de sql: /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock --log-slow- queries=/var/log/mysql/slow.log explain lai le jie SQL zhi xing de zhuang tai 。 explain select * from wp_posts\G; shi yong show status like "Handler_read%"; lai le jie suo yin de xiao guo 。 Handler_read_key zhi gao biao shi suo yin xiao guo hao ,Handler_read_rnd_next zhi gao biao shi suo yin di xiao 。 yong show processlist cha kan dang qian yun xing zhuang tai 。 mysql> show processlist; +-----+-------------+--------------------+ | Id | User | Host | db | Command | Time| State | Info +-----+-------------+--------------------+ |207|root |192.168.0.20:51718 |mytest | Sleep | 5 | | NULL |208|root |192.168.0.20:51719 |mytest | Sleep | 5 | | NULL |220|root |192.168.0.20:51731 |mytest |Query | 84 | Locked | select bookname,culture,value,type from book where id=001 xian jian dan shuo yi xia ge lie de han yi he yong tu , di yi lie ,id, bu yong shuo le ba , yi ge biao shi , ni yao kill yi ge yu ju de shi hou hen you yong 。user lie , xian shi dan qian yong hu , ru guo bu shi root, zhe ge ming ling jiu zhi xian shi ni quan xian fan wei nei de sql yu ju 。host lie , xian shi zhe ge yu ju shi cong na ge ip de na ge duan kou shang fa chu de 。 he he , ke yi yong lai zhui zong chu wen ti yu ju de yong hu 。db lie , xian shi zhe ge jin cheng mu qian lian jie de shi na ge shu ju ku 。command lie , xian shi dang qian lian jie de zhi xing de ming ling , yi ban jiu shi xiu mian (sleep), cha xun (query), lian jie (connect)。time lie , ci zhe ge zhuang tai chi xu de shi jian , dan wei shi miao 。state lie , xian shi shi yong dang qian lian jie de sql yu ju de zhuang tai , hen chong yao de lie , hou xu hui you suo you de zhuang tai de miao shu , qing zhu yi ,state zhi shi yu ju zhi xing zhong de mou yi ge zhuang tai , yi ge sql yu ju , yi cha xun wei li , ke neng xu yao jing guo copying to tmp table,Sorting result,Sending data deng zhuang tai cai ke yi wan cheng ,info lie , xian shi zhe ge sql yu ju , yin wei chang du you xian , suo yi chang de sql yu ju jiu xian shi bu quan , dan shi yi ge pan duan wen ti yu ju de chong yao yi ju 。 zhe ge ming ling zhong zui guan jian de jiu shi state lie ,mysql lie chu de zhuang tai zhu yao you yi xia ji zhong : Checking table zheng zai jian cha shu ju biao ( zhe shi zi dong de )。 Closing tables zheng zai jiang biao zhong xiu gai de shu ju shua xin dao ci pan zhong , tong shi zheng zai guan bi yi jing yong wan de biao 。 zhe shi yi ge hen kuai de cao zuo , ru guo bu shi zhe yang de hua , jiu ying gai que ren ci pan kong jian shi fou yi jing man le huo zhe ci pan shi fou zheng chu yu chong fu zhong 。 Connect Out fu zhi cong fu wu qi zheng zai lian jie zhu fu wu qi 。 Copying to tmp table on disk you yu lin shi jie guo ji da yu tmp_table_size, zheng zai jiang lin shi biao cong nei cun cun chu zhuan wei ci pan cun chu yi ci jie sheng nei cun 。 Creating tmp table zheng zai chuang jian lin shi biao yi cun fang bu fen cha xun jie guo 。 deleting from main table fu wu qi zheng zai zhi xing duo biao shan chu zhong de di yi bu fen , gang shan chu di yi ge biao 。 deleting from reference tables fu wu qi zheng zai zhi xing duo biao shan chu zhong de di er bu fen , zheng zai shan chu qi ta biao de ji lu 。 Flushing tables zheng zai zhi xing FLUSH TABLES, deng dai qi ta xian cheng guan bi shu ju biao 。 Killed fa song le yi ge kill qing qiu gei mou xian cheng , na me zhe ge xian cheng jiang hui jian cha kill biao zhi wei , tong shi hui fang qi xia yi ge kill qing qiu 。MySQL hui zai mei ci de zhu xun huan zhong jian cha kill biao zhi wei , bu guo you xie qing kuang xia gai xian cheng ke neng hui guo yi xiao duan cai neng si diao 。 ru guo gai xian cheng cheng bei qi ta xian cheng suo zhu le , na me kill qing qiu hui zai suo shi fang shi ma shang sheng xiao 。 Locked bei qi ta cha xun suo zhu le 。 Sending data zheng zai chu li SELECT cha xun de ji lu , tong shi zheng zai ba jie guo fa song gei ke hu duan 。 Sorting for group zheng zai wei GROUP BY zuo pai xu 。 Sorting for order zheng zai wei ORDER BY zuo pai xu 。 Opening tables zhe ge guo cheng ying gai hui hen kuai , chu fei shou dao qi ta yin su de gan rao 。 li ru , zai zhi ALTER TABLE huo LOCK TABLE yu ju xing wan yi qian , shu ju biao wu fa bei qi ta xian cheng da kai 。 zheng chang shi da kai yi ge biao 。 Removing duplicates zheng zai zhi xing yi ge SELECT DISTINCT fang shi de cha xun , dan shi MySQL wu fa zai qian yi ge jie duan you hua diao na xie chong fu de ji lu 。 yin ci ,MySQL xu yao zai ci qu diao chong fu de ji lu , ran hou zai ba jie guo fa song gei ke hu duan 。 Reopen table huo de le dui yi ge biao de suo , dan shi bi xu zai biao jie gou xiu gai zhi hou cai neng huo de zhe ge suo 。 yi jing shi fang suo , guan bi shu ju biao , zheng chang shi chong xin da kai shu ju biao 。 Repair by sorting xiu fu zhi ling zheng zai pai xu yi chuang jian suo yin 。 Repair with keycache xiu fu zhi ling zheng zai li yong suo yin huan cun yi ge yi ge di chuang jian xin suo yin 。 ta hui bi Repair by sorting man xie 。 Searching rows for update zheng zai jiang fu he tiao jian de ji lu zhao chu lai yi bei geng xin 。 ta bi xu zai UPDATE yao xiu gai xiang guan de ji lu zhi qian jiu wan cheng le 。 Sleeping zheng zai deng dai ke hu duan fa song xin qing qiu . System lock zheng zai deng dai qu de yi ge wai bu de xi tong suo 。 ru guo dang qian mei you yun xing duo ge mysqld fu wu qi tong shi qing qiu tong yi ge biao , na me ke yi tong guo zeng jia --skip-external-locking shen shu lai jin zhi wai bu xi tong suo 。 Upgrading lock INSERT DELAYED zheng zai chang shi qu de yi ge suo biao yi cha ru xin ji lu 。 Updating zheng zai sou suo pi pei de ji lu , bing qie xiu gai ta men 。 User Lock zheng zai deng dai GET_LOCK()。 Waiting for tables gai xian cheng de dao tong zhi , shu ju biao jie gou yi jing bei xiu gai le , xu yao chong xin da kai shu ju biao yi qu de xin de jie gou 。 ran hou , wei le neng de chong xin da kai shu ju biao , bi xu deng dao suo you qi ta xian cheng guan bi zhe ge biao 。 yi xia ji zhong qing kuang xia hui chan sheng zhe ge tong zhi :FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, huo OPTIMIZE TABLE。 waiting for handler insert INSERT DELAYED yi jing chu li wan le suo you dai chu li de cha ru cao zuo , zheng zai deng dai xin de qing qiu 。 da bu fen zhuang tai dui ying hen kuai de cao zuo , zhi yao you yi ge xian cheng bao chi tong yi ge zhuang tai hao ji miao zhong , na me ke neng shi you wen ti fa sheng le , xu yao jian cha yi xia 。 huan you qi ta de zhuang tai mei zai shang mian zhong lie chu lai , bu guo ta men da bu fen zhi shi zai cha kan fu wu qi shi fou you cun zai cuo wu shi cai yong de zhe 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
时尚秀气模特裴裴(8)
时尚秀气模特裴裴(7)
时尚秀气模特裴裴(6)
时尚秀气模特裴裴(5)
白墙黑瓦
广州东郊[原创]
八美至丹巴的东谷天然盆景
不一样的
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有