您好,我是小DAI,专注于数据库管理员相关的技术问答,请问有什么可以帮您?

sysquerymetrics

说明

根据持久数据为单个查询提供集合的历史查询处理指标。 除了监控表,还可以使用此目录中的性能指标信息

名称 数据类型 说明
uid int 用户 ID
gid int 组 ID
hashkey int SQL 查询文本上的散列键
id int 唯一 ID
sequence smallint null 在 SQL 文本需要多行的情况下行的序列号
exec_min int null 最短执行时间
exec_max int null 最长执行时间
exec_avg int null 平均执行时间
elap_min int null 最短经历时间
elap_max int null 最长经历时间
elap_avg int null 平均经历时间
lio_min int null 最小逻辑 IO
lio_max int null 最大逻辑 IO
lio_avg int null 平均逻辑 IO
pio_min int null 最小物理 IO
pio_max int null 最大物理 IO
pio_avg int null 平均物理 IO
cnt int null 已经执行的查询次数。
abort_cnt int null 由于超过资源限制资源管理器中止查询的次数
qtext varchar(255) null 查询文本

Adaptive Server 版本 15.0.2 和更高版本增加了在用户 ID 之间共享的指标数,减少了 sysquerymetrics(sysqueryplans 的一个视图)中的条目数,

并自动集合不同用户 ID 中相同查询的指标。

当查询中未被用户名限定的所有表名都归 DBO 所有时,sysquerymetrics 的用户 ID (uid) 将为 0。

例如,如果表 t1 只归 DBO 所有并且由不同用户共享:


select * from t1 where c1 = 1

对于没有名为 t1 的专用表的执行此查询的所有用户,Adaptive Server 将使用 0 作为 sysquerymetrics 条目的 uid。

在此示例中,如果表 t2 归“user1”所有并由其限定,Adaptive Server 也会使用 UID 0:


selet * from user1.t2 where c1 = 1

但是,如果表 t3 仅归“user1”所有,不由 DBO 限定,也不归 DBO 所有,则将在 sysquerymetrics 条目中使用“user1”的 UID:


select * from t3 where c1 = 1