windows azure mysql data disk_查询存储 - Azure Database for MySQL | Microsoft Docs

您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

通过查询存储监视 Azure Database for MySQL 性能Monitor Azure Database for MySQL performance with Query Store

5/12/2020

本文内容

适用于: Azure Database for MySQL 5.7、8.0Applies to: Azure Database for MySQL 5.7, 8.0

Azure Database for MySQL 中的查询存储功能提供了一种方法来跟踪一段时间内的查询性能。The Query Store feature in Azure Database for MySQL provides a way to track query performance over time. 通过帮助快速查找运行时间最长且资源最密集的查询,查询存储可简化性能故障排除。Query Store simplifies performance troubleshooting by helping you quickly find the longest running and most resource-intensive queries. 查询存储自动捕获查询和运行时统计信息的历史记录,并保留它们以供查看。Query Store automatically captures a history of queries and runtime statistics, and it retains them for your review. 它按时间范围分隔数据,以便可以查看数据库使用模式。It separates data by time windows so that you can see database usage patterns. 所有用户、数据库和查询的数据都存储在 Azure Database for MySQL 实例上的 mysql 架构数据库中。Data for all users, databases, and queries is stored in the mysql schema database in the Azure Database for MySQL instance.

使用查询存储的常见场景Common scenarios for using Query Store

可以在许多场景中使用查询存储,包括:Query store can be used in a number of scenarios, including the following:

检测回归查询Detecting regressed queries

确定在给定时间范围内执行查询的次数Determining the number of times a query was executed in a given time window

比较跨时间范围查询的平均执行时间,以查看较大的增量Comparing the average execution time of a query across time windows to see large deltas

启用查询存储Enabling Query Store

查询存储是一项选择加入功能,因此默认情况下它在服务器上未处于活动状态。Query Store is an opt-in feature, so it isn't active by default on a server. 对于给定服务器上的所有数据库,查询存储处于全局启用或禁用状态,且无法为每个数据库打开或关闭它。The query store is enabled or disabled globally for all the databases on a given server and cannot be turned on or off per database.

使用 Azure 门户启用查询存储Enable Query Store using the Azure portal

登录到 Azure 门户,选择你的 Azure Database for MySQL 服务器。Sign in to the Azure portal and select your Azure Database for MySQL server.

在菜单的“设置”部分中选择“服务器参数” 。Select Server Parameters in the Settings section of the menu.

搜索 query_store_capture_mode 参数。Search for the query_store_capture_mode parameter.

将值设置为 ALL,然后 保存。Set the value to ALL and Save.

若要在查询存储中启用等待统计信息,请执行以下操作:To enable wait statistics in your Query Store:

搜索 query_store_wait_sampling_capture_mode 参数。Search for the query_store_wait_sampling_capture_mode parameter.

将值设置为 ALL,然后 保存。Set the value to ALL and Save.

留出最多 20 分钟以便第一批数据保存到 mysql 数据库中。Allow up to 20 minutes for the first batch of data to persist in the mysql database.

查询存储中的信息Information in Query Store

查询存储有两个存储:Query Store has two stores:

用于保存查询执行统计信息的运行时统计信息存储。A runtime statistics store for persisting the query execution statistics information.

用于保存等待统计信息的等待统计信息存储。A wait statistics store for persisting wait statistics information.

为尽量减少空间使用量,运行时统计信息存储中的运行时执行统计信息在一个固定的、可配置的时间范围内聚合。To minimize space usage, the runtime execution statistics in the runtime statistics store are aggregated over a fixed, configurable time window. 通过查询这些查询存储视图,这些存储中的信息是可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值