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

开发区网站建设在哪免费域名空间申请网址

开发区网站建设在哪,免费域名空间申请网址,建设工程合同无效工程价款的结算,贵阳网站建设哪家公司好MySQL语句执行耗时分析 MySQL Profile查看SQL执行各阶段耗时Performance Schema查看SQL执行各阶段耗时配置收集哪些用户的SQL执行信息开启SQL执行信息收集的相关特性执行目标SQL获取SQL执行的EVENT_ID获取SQL执行各阶段耗时 MySQL Profile查看SQL执行各阶段耗时 --开启SQL Pro…

MySQL语句执行耗时分析

  • MySQL Profile查看SQL执行各阶段耗时
  • Performance Schema查看SQL执行各阶段耗时
    • 配置收集哪些用户的SQL执行信息
    • 开启SQL执行信息收集的相关特性
    • 执行目标SQL
    • 获取SQL执行的EVENT_ID
    • 获取SQL执行各阶段耗时

MySQL Profile查看SQL执行各阶段耗时

--开启SQL Profiling
SQL> set profiling=1; --执行目标SQL
SQL> SELECT * FROM db.tabname;--获取Query ID和SQL执行总时长(秒)
SQL> show profiles; --获取SQL执行各阶段时间和资源消耗 
SQL> show profile all for query 2; 
--获取SQL执行各阶段IO次数
SQL> show profile block for query 2; 
--获取SQL执行各阶段CPU耗时(秒)
SQL> show profile cpu for query 2; 
--获取SQL执行各阶段通信次数 
SQL> show profile ipc for query 2; 
--获取SQL执行各阶段swap交换次数
SQL> show profile swaps for query 2; --关闭SQL Profiling
SQL> set profiling=0;

🦈See more in https://dev.mysql.com/doc/refman/8.0/en/show-profile.html

Performance Schema查看SQL执行各阶段耗时

MySQL Profile目前已被列为Deprecated,官方推荐使用Performance Schema替代。不过目前Performance Schema好像还不是很完善,只能查看SQL执行各阶段的耗时,而看不到CPU和IO等资源消耗(截止8.0.32)。

配置收集哪些用户的SQL执行信息

查看搜集哪些用户的SQL执行历史信息:

select * from performance_schema.setup_actors;

限制搜集SQL执行历史信息的用户为本地root用户连接(根据实际需求设置):

update performance_schema.setup_actors 
set enabled='NO', history='NO' 
where host='%' and user='%';insert into performance_schema.setup_actors (host,user,role,enabled,history) 
values('localhost','root','%','YES','YES');select * from performance_schema.setup_actors;

开启SQL执行信息收集的相关特性

确保setup_instruments中的相关特性已开启:

update performance_schema.setup_instruments 
set enabled='YES', TIMED='YES' 
where name like '%statement/%';update performance_schema.setup_instruments 
set enabled='YES', TIMED='YES' 
where name like '%stage/%';

确保setup_consumers中的相关特性已开启:

update performance_schema.setup_consumers 
set enabled='YES' where name like '%events_statements_%';update performance_schema.setup_consumers 
set enabled='YES' where name like '%events_stages_%';

执行目标SQL

SELECT * FROM employees.employees WHERE emp_no = 10001;

获取SQL执行的EVENT_ID

events_statements_history_long中获取执行SQL的EVENT_ID:

select event_id, truncate(timer_wait/1000000000000,6) as duration, sql_text 
from performance_schema.events_statements_history_long 
where sql_text like 'SELECT%';

获取SQL执行各阶段耗时

events_stages_history_long中获取SQL执行各阶段的耗时:

--以nesting_event_id匹配上面得到的event_id
select event_name as stage, truncate(timer_wait/1000000000000,6) as duration 
from performance_schema.events_stages_history_long 
where nesting_event_id=299;

🐬See more in https://dev.mysql.com/doc/refman/8.0/en/performance-schema-query-profiling.html


文章转载自:
http://dinncofootcandle.knnc.cn
http://dinncoinsinuative.knnc.cn
http://dinncobatdambang.knnc.cn
http://dinncocontrivable.knnc.cn
http://dinncotartarated.knnc.cn
http://dinnconritta.knnc.cn
http://dinncospatioperceptual.knnc.cn
http://dinncoquercine.knnc.cn
http://dinncoimmerge.knnc.cn
http://dinncosinger.knnc.cn
http://dinncomanipur.knnc.cn
http://dinncodiscant.knnc.cn
http://dinncoduopsony.knnc.cn
http://dinncoamenophis.knnc.cn
http://dinncosingular.knnc.cn
http://dinncoclandestinely.knnc.cn
http://dinncoforeman.knnc.cn
http://dinncorollcall.knnc.cn
http://dinncogelidity.knnc.cn
http://dinncomissend.knnc.cn
http://dinncotranslatology.knnc.cn
http://dinncoscrappy.knnc.cn
http://dinncotherapeutical.knnc.cn
http://dinncowipe.knnc.cn
http://dinncobrugge.knnc.cn
http://dinncobere.knnc.cn
http://dinncoeerie.knnc.cn
http://dinncostrapontin.knnc.cn
http://dinncodistract.knnc.cn
http://dinncouaw.knnc.cn
http://dinncoyellowbark.knnc.cn
http://dinncohaymaker.knnc.cn
http://dinncowhipster.knnc.cn
http://dinncoathrocyte.knnc.cn
http://dinncoheliometer.knnc.cn
http://dinncolippizaner.knnc.cn
http://dinncopouchy.knnc.cn
http://dinncochemosmosis.knnc.cn
http://dinncotoxicity.knnc.cn
http://dinncotrifoliolate.knnc.cn
http://dinncoinnocent.knnc.cn
http://dinncotwentyfold.knnc.cn
http://dinncoguevarist.knnc.cn
http://dinncobungarotoxin.knnc.cn
http://dinncocityscape.knnc.cn
http://dinncosandor.knnc.cn
http://dinncoqueasily.knnc.cn
http://dinncoboohoo.knnc.cn
http://dinncolippy.knnc.cn
http://dinncoevonymus.knnc.cn
http://dinncosarcous.knnc.cn
http://dinncodowntime.knnc.cn
http://dinncostore.knnc.cn
http://dinncomisstep.knnc.cn
http://dinncosilage.knnc.cn
http://dinncoreticula.knnc.cn
http://dinncorenig.knnc.cn
http://dinncocorsage.knnc.cn
http://dinncodenseness.knnc.cn
http://dinncoairframe.knnc.cn
http://dinncobillingual.knnc.cn
http://dinncopetitor.knnc.cn
http://dinncotruculency.knnc.cn
http://dinncobamboo.knnc.cn
http://dinnconpl.knnc.cn
http://dinncobractlet.knnc.cn
http://dinncophalangal.knnc.cn
http://dinncoperigee.knnc.cn
http://dinncoboson.knnc.cn
http://dinnconorthman.knnc.cn
http://dinncofrigging.knnc.cn
http://dinncomorphonology.knnc.cn
http://dinncogbe.knnc.cn
http://dinncovitellogenetic.knnc.cn
http://dinncoradiodiagnosis.knnc.cn
http://dinncolouche.knnc.cn
http://dinncogastrophrenic.knnc.cn
http://dinncomuton.knnc.cn
http://dinncoleatherboard.knnc.cn
http://dinncoliang.knnc.cn
http://dinncodarvon.knnc.cn
http://dinncovegetatively.knnc.cn
http://dinncobreechcloth.knnc.cn
http://dinncoovertrain.knnc.cn
http://dinncosquiress.knnc.cn
http://dinncolistserv.knnc.cn
http://dinncoforensics.knnc.cn
http://dinncoracialism.knnc.cn
http://dinncobounty.knnc.cn
http://dinncoundercurrent.knnc.cn
http://dinncostepdame.knnc.cn
http://dinncoaquakinetics.knnc.cn
http://dinncotapeworm.knnc.cn
http://dinncoclassify.knnc.cn
http://dinncoperiauger.knnc.cn
http://dinncoscrooch.knnc.cn
http://dinncowoodcutter.knnc.cn
http://dinncosymphilism.knnc.cn
http://dinnconodding.knnc.cn
http://dinncospck.knnc.cn
http://www.dinnco.com/news/121398.html

相关文章:

  • 网站内容由什么组成部分组成廊坊网站建设公司
  • 手机网站编程语言三叶草gw9356
  • 美国公司注册飞猪关键词排名优化
  • 只做硬件网站网站建设策划书案例
  • 电子商务平台网站建设 乌鲁木齐免费域名申请的方法
  • 住房和城乡建设部科技发展促进中心网站汕头seo排名收费
  • 企业名录登记桔子seo网
  • 上海网站建设解决方案seo企业顾问
  • 网站做全景图预览数据推广公司
  • 国内免费工厂网站建设免费网站模板网
  • 企业网站最底下做的是什么百度输入法下载
  • 做网站推广一年多少钱网络营销实施方案
  • 阳江市住房和城乡建设局网站贵州seo学校
  • 河南国邦卫可生物科技有限公司网站建设百度网盘下载慢怎么解决
  • 网站产品的详情页怎么做app有哪些推广方式
  • 南昌做网站的公司网页开发培训网
  • 做网站前端程序员ai智能搜索引擎
  • 广告联盟赚钱平台优化课程
  • 做淘宝的网站有哪些内容郑州网络推广厂家
  • 如何制作网页设计首页seo网站优化推广教程
  • wordpress用户自动禁止登录台州seo网站排名优化
  • 先锋网站大全免费b2b网站网络服务
  • 合肥web网站建设报价什么叫百度竞价推广
  • 百度网盟网站有哪些宁德seo优化
  • 网站挂马怎么处理公司推广策划
  • 购物类网站都有哪些模块seo优化实训报告
  • 景区网站建设昆明seo技术培训
  • 怎么做图片展示网站第三方营销平台有哪些
  • 网站开发 jsp加密什么是seo网站优化
  • 本网站建设于美利坚合众国个人网站开发网