---
schema_version: "1"
id: 65d9e8833549694fec10a8caad6d464a7b7a9df6d57e365379c68fe6a5e4f564
title: 查詢緩慢
collection: tableau
version: current
locale: zh-tw
portal_url: https://docs.salesforce.com/tableau/current/zh-tw/server-linux/rmt-incidents-slow-query.md
canonical_url: https://help.tableau.com/current/server-linux/zh-tw/rmt-incidents-slow-query.htm
source_site: help.tableau.com
content_type: documentation
content_hash: db648b48a24d3a6e3f56fa9972c0dfc688da686f17462547c3e4e06110881a72
description: Understand and configure slow query incidents in the Resource Monitoring Tool.
---
[跳至主要內容](#main-content)

# 查詢緩慢事件

當任何資料查詢遲遲無法完成時，就會觸發_查詢緩慢_事件。預設情況下，如果任何資料查詢執行時間至少為 30 秒，則「緩慢的查詢」事件將觸發警告。

可以使用 RMT 伺服器 Web 介面或透過更新組態檔 `config.json` 來設定臨界值。

若要設定查詢緩慢事件的閾值，請在**「管理」**功能表下選擇**「組態」**，再前往**「事件」**索引標籤。

<table style="width: 100%;" class="simple-table"><colgroup><col><col><col></colgroup><thead><tr><th>主要</th><th>是否為必要項目？</th><th>描述</th></tr></thead><tbody><tr><td><b>嚴重性</b></td><td>必要</td><td><p>請參閱<a href="https://help.tableau.com/current/server-linux/zh-tw/rmt-incidents-index-incidents.htm#incident-severity-levels">事件嚴重性層級</a>。</p></td></tr><tr><td><b>持續時間</b></td><td>必要</td><td>要將查詢視為緩慢的最小期間。值以秒為單位。</td></tr></tbody></table>

定義查詢緩慢事件的程式碼片段 `config.json` 範例如下：

```
{  
 "monitoring":  {  
    "incidents":  {  
      "triggers":  [  
        {  
          "counter":  "DataQueryDuration",  
          "severity":  "critical",  
          "threshold":  45000  
        }  
      ]  
    }  
  }  
}
```

如果資料查詢至少需要　45　秒才能執行，則會觸發查詢緩慢事件。

事件可以按照個別環境加以設定。例如，對於其識別碼為「staging-environment」的環境，在資料查詢需等候　30　秒以上才能執行時，就會觸發警告，其組態如下：

```
{  
  "environments":  {  
    "staging-environment":  {  
     "monitoring":  {  
       "incidents":  {  
          "triggers":  [  
            {  
              "counter":  "DataQueryDuration",  
              "severity":  "warning",  
              "threshold":  30000  
            }  
          ]  
        }  
      }  
    }  
  }  
}
```

| 主要 | 資料類型 | 是否為必要項目？ | 描述 |
| --- | --- | --- | --- |
| `counter` | 字串 | 必要 | 查詢緩慢事件使用 `DataQueryDuration` 識別碼。 |
| `severity` | 字串 | 選用 | 請參閱[事件嚴重性層級](https://help.tableau.com/current/server-linux/zh-tw/rmt-incidents-index-incidents.htm#incident-severity-levels)。預設值：`Warning` |
| `threshold` | 數字 | 必要 | 要將查詢視為緩慢的最小期間。值以毫秒為單位。 |

## 誰可以執行此動作

Resource Monitoring Tool 管理員或具備**伺服器/環境管理**角色的 Resource Monitoring Tool 使用者。