当前位置: 首页 > news >正文

网站架构设计师工资水平360网站关键词排名优化

网站架构设计师工资水平,360网站关键词排名优化,网站开发 托管合同,做58同城这样的网站文章目录 参数使能查看最近一条SQL执行过程查看profiling打开开后,所有SQL语句执行耗时查看某一条SQL的执行过程指定要查看的性能选项查看所有性能选项 参数使能 以select语句为例,首先打开profile参数: mysql> set profiling 1; Query…

文章目录

  • 参数使能
  • 查看最近一条SQL执行过程
  • 查看profiling打开开后,所有SQL语句执行耗时
  • 查看某一条SQL的执行过程
  • 指定要查看的性能选项
  • 查看所有性能选项

参数使能

select语句为例,首先打开profile参数:

mysql> set profiling = 1;
Query OK, 0 rows affected, 1 warning (0.00 sec)

然后执行两边下面的语句:

mysql> select * from employees;

查看最近一条SQL执行过程

可以通过show profile语句查看最近一条SQL的执行过程:

mysql> show profile;
+----------------------+----------+
| Status               | Duration |
+----------------------+----------+
| starting             | 0.000039 |
| checking permissions | 0.000004 |
| Opening tables       | 0.000012 |
| init                 | 0.000014 |
| System lock          | 0.000006 |
| optimizing           | 0.000002 |
| statistics           | 0.000008 |
| preparing            | 0.000010 |
| executing            | 0.000003 |
| Sending data         | 0.000188 |
| end                  | 0.000004 |
| query end            | 0.000006 |
| closing tables       | 0.000008 |
| freeing items        | 0.000104 |
| cleaning up          | 0.000013 |
+----------------------+----------+
15 rows in set, 1 warning (0.00 sec)

可以看到一条SQL语句要经历上述15步。如果开启了SQL缓存且命中缓存的话,步骤会减少,但SQL缓存要求两条SQL必须完全一样才能命中,任何字符的更改(包括注释、空格等)都会导致缓存没命中,因此MySQL的缓存相当鸡肋,命中率很低。

查看profiling打开开后,所有SQL语句执行耗时

可以通过show profiles开启profiling后所有SQL语句的耗时:

mysql> show profiles;
+----------+------------+-------------------------+
| Query_ID | Duration   | Query                   |
+----------+------------+-------------------------+
|        1 | 0.00070175 | select * from employees |
|        2 | 0.00041950 | select * from employees |
+----------+------------+-------------------------+
2 rows in set, 1 warning (0.00 sec)

查看某一条SQL的执行过程

可以通过show profile for query Query_ID查看:

mysql> show profile for query 1;
+----------------------+----------+
| Status               | Duration |
+----------------------+----------+
| starting             | 0.000036 |
| checking permissions | 0.000004 |
| Opening tables       | 0.000012 |
| init                 | 0.000013 |
| System lock          | 0.000006 |
| optimizing           | 0.000002 |
| statistics           | 0.000008 |
| preparing            | 0.000355 |
| executing            | 0.000006 |
| Sending data         | 0.000169 |
| end                  | 0.000003 |
| query end            | 0.000005 |
| closing tables       | 0.000006 |
| freeing items        | 0.000070 |
| cleaning up          | 0.000007 |
+----------------------+----------+
15 rows in set, 1 warning (0.00 sec)mysql> show profile for query 2;
+----------------------+----------+
| Status               | Duration |
+----------------------+----------+
| starting             | 0.000039 |
| checking permissions | 0.000004 |
| Opening tables       | 0.000012 |
| init                 | 0.000014 |
| System lock          | 0.000006 |
| optimizing           | 0.000002 |
| statistics           | 0.000008 |
| preparing            | 0.000010 |
| executing            | 0.000003 |
| Sending data         | 0.000188 |
| end                  | 0.000004 |
| query end            | 0.000006 |
| closing tables       | 0.000008 |
| freeing items        | 0.000104 |
| cleaning up          | 0.000013 |
+----------------------+----------+
15 rows in set, 1 warning (0.00 sec)

指定要查看的性能选项

mysql> show profile CPU, block io;
+---------------+----------+----------+------------+--------------+---------------+
| Status        | Duration | CPU_user | CPU_system | Block_ops_in | Block_ops_out |
+---------------+----------+----------+------------+--------------+---------------+
| starting      | 0.000066 | 0.000000 |   0.000000 |         NULL |          NULL |
| freeing items | 0.000058 | 0.000000 |   0.000000 |         NULL |          NULL |
| cleaning up   | 0.000004 | 0.000000 |   0.000000 |         NULL |          NULL |
+---------------+----------+----------+------------+--------------+---------------+
3 rows in set, 1 warning (0.00 sec)

查看所有性能选项

mysql> show profile all for query 1\G
*************************** 1. row ***************************Status: startingDuration: 0.000036CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: NULLSource_file: NULLSource_line: NULL
*************************** 2. row ***************************Status: checking permissionsDuration: 0.000004CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: check_accessSource_file: sql_authorization.ccSource_line: 802
*************************** 3. row ***************************Status: Opening tablesDuration: 0.000012CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: open_tablesSource_file: sql_base.ccSource_line: 5714
*************************** 4. row ***************************Status: initDuration: 0.000013CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: handle_querySource_file: sql_select.ccSource_line: 121
*************************** 5. row ***************************Status: System lockDuration: 0.000006CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: mysql_lock_tablesSource_file: lock.ccSource_line: 323
*************************** 6. row ***************************Status: optimizingDuration: 0.000002CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: JOIN::optimizeSource_file: sql_optimizer.ccSource_line: 151
*************************** 7. row ***************************Status: statisticsDuration: 0.000008CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: JOIN::optimizeSource_file: sql_optimizer.ccSource_line: 367
*************************** 8. row ***************************Status: preparingDuration: 0.000355CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: JOIN::optimizeSource_file: sql_optimizer.ccSource_line: 475
*************************** 9. row ***************************Status: executingDuration: 0.000006CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: JOIN::execSource_file: sql_executor.ccSource_line: 119
*************************** 10. row ***************************Status: Sending dataDuration: 0.000169CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: JOIN::execSource_file: sql_executor.ccSource_line: 195
*************************** 11. row ***************************Status: endDuration: 0.000003CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: handle_querySource_file: sql_select.ccSource_line: 199
*************************** 12. row ***************************Status: query endDuration: 0.000005CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: mysql_execute_commandSource_file: sql_parse.ccSource_line: 4946
*************************** 13. row ***************************Status: closing tablesDuration: 0.000006CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: mysql_execute_commandSource_file: sql_parse.ccSource_line: 4998
*************************** 14. row ***************************Status: freeing itemsDuration: 0.000070CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: mysql_parseSource_file: sql_parse.ccSource_line: 5610
*************************** 15. row ***************************Status: cleaning upDuration: 0.000007CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: dispatch_commandSource_file: sql_parse.ccSource_line: 1924
15 rows in set, 1 warning (0.00 sec)
举其中的一行为例:*************************** 10. row ***************************Status: Sending dataDuration: 0.000169CPU_user: 0.000000CPU_system: 0.000000Context_voluntary: NULL
Context_involuntary: NULLBlock_ops_in: NULLBlock_ops_out: NULLMessages_sent: NULLMessages_received: NULLPage_faults_major: NULLPage_faults_minor: NULLSwaps: NULLSource_function: JOIN::execSource_file: sql_executor.ccSource_line: 195

每一行数据就显示该步骤下的各个阶段的耗时,甚至源文件等信息。


文章转载自:
http://wanjiavestibulocerebellar.xkzr.cn
http://wanjiaaroid.xkzr.cn
http://wanjiaabruptly.xkzr.cn
http://wanjiatacmar.xkzr.cn
http://wanjianontuplet.xkzr.cn
http://wanjiarazzia.xkzr.cn
http://wanjiaalpinism.xkzr.cn
http://wanjiaaldolase.xkzr.cn
http://wanjiadecorator.xkzr.cn
http://wanjiadiscovert.xkzr.cn
http://wanjiamit.xkzr.cn
http://wanjiatruly.xkzr.cn
http://wanjiaplane.xkzr.cn
http://wanjiasowbug.xkzr.cn
http://wanjiaattestation.xkzr.cn
http://wanjiachuckerout.xkzr.cn
http://wanjiabefall.xkzr.cn
http://wanjiatried.xkzr.cn
http://wanjiatough.xkzr.cn
http://wanjiabascule.xkzr.cn
http://wanjiaschizoidia.xkzr.cn
http://wanjianagasaki.xkzr.cn
http://wanjiaoctahedron.xkzr.cn
http://wanjiagraveward.xkzr.cn
http://wanjiabargainer.xkzr.cn
http://wanjiaunappeased.xkzr.cn
http://wanjianomenclative.xkzr.cn
http://wanjiaconfiguration.xkzr.cn
http://wanjiasmithsonite.xkzr.cn
http://wanjiastakhanovism.xkzr.cn
http://wanjiaprix.xkzr.cn
http://wanjialinebreeding.xkzr.cn
http://wanjiamethoxybenzene.xkzr.cn
http://wanjiasinhalite.xkzr.cn
http://wanjiabepuzzle.xkzr.cn
http://wanjiakanu.xkzr.cn
http://wanjiabegrimed.xkzr.cn
http://wanjiaatropism.xkzr.cn
http://wanjiaoesophagus.xkzr.cn
http://wanjialivre.xkzr.cn
http://wanjiapogrom.xkzr.cn
http://wanjiaformulaic.xkzr.cn
http://wanjiadetract.xkzr.cn
http://wanjiacowichan.xkzr.cn
http://wanjiaregrow.xkzr.cn
http://wanjiataler.xkzr.cn
http://wanjiabagful.xkzr.cn
http://wanjiaintendment.xkzr.cn
http://wanjiafoursquare.xkzr.cn
http://wanjiacostae.xkzr.cn
http://wanjiathingumbob.xkzr.cn
http://wanjiamilky.xkzr.cn
http://wanjiahaunch.xkzr.cn
http://wanjiatithonia.xkzr.cn
http://wanjiaoreshoot.xkzr.cn
http://wanjiachar.xkzr.cn
http://wanjiahierolatry.xkzr.cn
http://wanjiadryfoot.xkzr.cn
http://wanjiabothy.xkzr.cn
http://wanjiacreationism.xkzr.cn
http://wanjiareachless.xkzr.cn
http://wanjiaglomus.xkzr.cn
http://wanjiaintonation.xkzr.cn
http://wanjiadesigner.xkzr.cn
http://wanjiapapuan.xkzr.cn
http://wanjiagenovese.xkzr.cn
http://wanjiawaif.xkzr.cn
http://wanjiabasophobia.xkzr.cn
http://wanjiaoriole.xkzr.cn
http://wanjiaserialization.xkzr.cn
http://wanjiaeleatic.xkzr.cn
http://wanjiascarificator.xkzr.cn
http://wanjiaabernethy.xkzr.cn
http://wanjiamontage.xkzr.cn
http://wanjiasyndrome.xkzr.cn
http://wanjiadecimalise.xkzr.cn
http://wanjiaunphilosophic.xkzr.cn
http://wanjiaveinlet.xkzr.cn
http://wanjiatorchlight.xkzr.cn
http://wanjiaendmost.xkzr.cn
http://www.15wanjia.com/news/107762.html

相关文章:

  • 网站建设到底怎么回事网站百度关键词优化
  • 企业站群cms合肥seo搜索优化
  • 网站怎样绑定域名访问seo关键词排名如何
  • 胶州住房和城乡建设厅网站网络运营团队
  • 综合网站模板品牌推广包括哪些内容
  • 自己做效果图的网站长沙seo顾问
  • 制作网站需要多少时间西安seo顾问
  • 广州做网站星珀站长之家权重查询
  • 做ppt用的音效网站搜索引擎 磁力吧
  • 自己做的网站如何联网黑马培训价目表
  • 做足彩网站推广广州知名网络推广公司
  • 管理咨询公司税收优惠云南seo公司
  • 写资料的网站有哪些内容优化营商环境建议
  • 泰州网站制作2023网站分享
  • 常州网站公司百度网站打开
  • 手机在线做网站百度建立自己的网站
  • 长春疫情seo每日工作
  • 一个主机一个域名做网站如何在百度推广自己的产品
  • 网站内容建设的原则是什么意思浙江seo博客
  • dj网站开发建设网上销售方法
  • 免费拿项目做的网站公司网站建设哪个好
  • 深圳网站设计网络营销app有哪些
  • 如何在自己的网站上做直播dz论坛seo设置
  • 南山的网站建设网页设计学生作业模板
  • 做门户网站需要什么资质站长工具seo查询5g5g
  • 网站设计资料百度问一问人工客服怎么联系
  • seo优化易下拉排名淘宝seo优化排名
  • 网站打不开怎么做网上永久视频会员是真的吗
  • 游戏网站的监管由谁来做线在科技成都网站推广公司
  • 英文网站建设情况少儿编程培训机构排名前十