gpt4 book ai didi

postgresql - 适用于 Postgres 灵活服务器的 Azure 日志分析

转载 作者:行者123 更新时间:2023-12-03 04:40:37 26 4
gpt4 key购买 nike

只是尝试将 Azure 日志分析中预先存在的“最慢查询 - 前 5 个”用于 postgres 灵活服务器。提供的查询是:

// Slowest queries 
// Identify top 5 slowest queries.
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORPOSTGRESQL"
| where Category == "QueryStoreRuntimeStatistics"
| where user_id_s != "10" //exclude azure system user
| summarize avg(todouble(mean_time_s)) by event_class_s , db_id_s ,query_id_s
| top 5 by avg_mean_time_s desc

此查询导致错误:

“where”运算符:无法解析名为“user_id_s”的列或标量表达式如果问题仍然存在,请开具支持票证。请求ID:XXXX

我猜测没有配置某些内容来利用 user_id_s 列。如有任何帮助,我们将不胜感激。

最佳答案

我希望您检查整数值10是否不等于user_id_s。在您的 KQL 查询中 user_id_s != "10"

谢谢@venkateshdodda-msft我添加您的建议以帮助解决该问题。

如果您在 KQL 中使用整数,请确保删除""<强>双引号

# using as a integer
| where user_id_s != 10

或者使用将整数转换为字符串

# converting into string
| extend user_id_s = tostring(Properties.user_id_s)
| where UserId in ('10')

修改后的 KQL 查询

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DBFORPOSTGRESQL"
| where Category == "QueryStoreRuntimeStatistics"
# using as a integer
| where user_id_s != 10 //exclude azure system user
| summarize avg(todouble(mean_time_s)) by event_class_s , db_id_s ,query_id_s
| top 5 by avg_mean_time_s desc

引用:

  1. Operator failed to resolve table or column expression
  2. Converting integer to string

关于postgresql - 适用于 Postgres 灵活服务器的 Azure 日志分析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72791503/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com