已合并
wdr enhance doc #8890
shenzheng4创建于 9月28日
wdr enhance doc #8890
已合并
shenzheng4创建于 9月28日
共 54 个文件变更+723-31
@@ -75,7 +75,7 @@ The WDR depends on the following two components:
75</tr>75</tr>
76<tr id="row123476454170"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p934714512178"><a name="p934714512178"></a><a name="p934714512178"></a>Memory Statistics</p>76<tr id="row123476454170"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p934714512178"><a name="p934714512178"></a><a name="p934714512178"></a>Memory Statistics</p>
77</td>77</td>
78-<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p434712455175"><a name="p434712455175"></a><a name="p434712455175"></a>Includes maximum process memory, used process memory, maximum shared memory, and used shared memory.</p>78+<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p434712455175"><a name="p434712455175"></a><a name="p434712455175"></a>Includes maximum process memory, used process memory, maximum shared memory, used shared memory, and key shared-memory component sizes and percentages.</p>
79</td>79</td>
80</tr>80</tr>
81</tbody>81</tbody>
@@ -96,10 +96,16 @@ The WDR depends on the following two components:
96<p id="p33332484313"><a name="p33332484313"></a><a name="p33332484313"></a>The statistics include time consumed by the system in each phase, including the kernel time, CPU time, execution time, parsing time, compilation time, query rewriting time, plan generation time, network time, and I/O time.</p>96<p id="p33332484313"><a name="p33332484313"></a><a name="p33332484313"></a>The statistics include time consumed by the system in each phase, including the kernel time, CPU time, execution time, parsing time, compilation time, query rewriting time, plan generation time, network time, and I/O time.</p>
97</td>97</td>
98</tr>98</tr>
99+<tr id="row-protocol-statistics"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p>Protocol Statistics</p>
100+</td>
101+<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p>Diagnoses protocol-message execution count and elapsed time.</p>
102+<p>Includes Simple Query, Parse, Bind, Execute, Describe, Sync, Close, and Batch Bind-Execute with Exec Count, Total Time(s), Avg Time(ms), and % of DB Time.</p>
103+</td>
104+</tr>
99<tr id="row1233374883113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p10333948163119"><a name="p10333948163119"></a><a name="p10333948163119"></a>SQL Statistics</p>105<tr id="row1233374883113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p10333948163119"><a name="p10333948163119"></a><a name="p10333948163119"></a>SQL Statistics</p>
100</td>106</td>
101<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p367217315715"><a name="p367217315715"></a><a name="p367217315715"></a>Diagnoses SQL statement performance problems.</p>107<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p367217315715"><a name="p367217315715"></a><a name="p367217315715"></a>Diagnoses SQL statement performance problems.</p>
102-<p id="p103331848113117"><a name="p103331848113117"></a><a name="p103331848113117"></a>The statistics include normalized SQL performance indicators in multiple dimensions: elapsed time, CPU time, rows returned, tuple reads, executions, physical reads, and logical reads. The indicators can be classified into execution time, number of execution times, row activity, and cache I/O.</p>108+<p id="p103331848113117"><a name="p103331848113117"></a><a name="p103331848113117"></a>The statistics include normalized SQL performance indicators in multiple dimensions: elapsed time, CPU time, rows returned, tuple reads, executions, physical reads, and logical reads. The indicators can be classified into execution time, number of execution times, row activity, and cache I/O. Per-database execution count and elapsed time are also included.</p>
103</td>109</td>
104</tr>110</tr>
105<tr id="row1933324873111"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p183331348193119"><a name="p183331348193119"></a><a name="p183331348193119"></a>Wait Events</p>111<tr id="row1933324873111"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p183331348193119"><a name="p183331348193119"></a><a name="p183331348193119"></a>Wait Events</p>
@@ -123,7 +129,7 @@ The WDR depends on the following two components:
123<tr id="row123341448113113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p11334848143110"><a name="p11334848143110"></a><a name="p11334848143110"></a>Object stats</p>129<tr id="row123341448113113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p11334848143110"><a name="p11334848143110"></a><a name="p11334848143110"></a>Object stats</p>
124</td>130</td>
125<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p14405135119915"><a name="p14405135119915"></a><a name="p14405135119915"></a>Diagnoses the performance of database objects.</p>131<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p14405135119915"><a name="p14405135119915"></a><a name="p14405135119915"></a>Diagnoses the performance of database objects.</p>
126-<p id="p6334174863119"><a name="p6334174863119"></a><a name="p6334174863119"></a>The statistics include user tables, tables on indexes, index scan activities, as well as insert, update, and delete activities, number of valid rows, and table maintenance status.</p>132+<p id="p6334174863119"><a name="p6334174863119"></a><a name="p6334174863119"></a>The statistics include user tables, tables on indexes, index scan activities, as well as insert, update, and delete activities, number of valid rows, table maintenance status, and unused user indexes in the snapshot interval.</p>
127</td>133</td>
128</tr>134</tr>
129<tr id="row1427793219359"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p32775326355"><a name="p32775326355"></a><a name="p32775326355"></a>Configuration settings</p>135<tr id="row1427793219359"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p32775326355"><a name="p32775326355"></a><a name="p32775326355"></a>Configuration settings</p>
@@ -142,7 +148,10 @@ The WDR depends on the following two components:
142 148 
143## Enhancements<a name="section9602018103411"></a>149## Enhancements<a name="section9602018103411"></a>
144 150 
145-None.151+- Shared Memory Statistics: Top 10 shared-memory candidate components by size plus (Total). Node-wide report, which can be viewed in node mode for summary or all report types.
152+- Protocol Statistics (Protocol Message Statistics): Exec Count, Total Time(s), Avg Time(ms), and % of DB Time for eight protocol message types. Node-wide report, which can be viewed in node mode for detail or all report types.
153+- SQL Stats by Database: per-database SQL execution count and elapsed time. Node-wide report, which can be viewed in node mode for detail or all report types.
154+- Unused Indexes: unused user indexes in the snapshot interval under Object stats. Database/Node-wide report, which can be viewed in cluster or node mode for detail or all report types.
146 155 
147## Constraints<a name="section1956417145819"></a>156## Constraints<a name="section1956417145819"></a>
148 157 
@@ -45,5 +45,12 @@
45<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"><a name="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"></a><a name="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"></a>Time value, in μs</p>45<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"><a name="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"></a><a name="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"></a>Time value, in μs</p>
46</td>46</td>
47</tr>47</tr>
48+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
49+</td>
50+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
51+</td>
52+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>Cumulative call count for the corresponding time type (used by protocol-message statistics deltas).</p>
53+</td>
54+</tr>
48</tbody>55</tbody>
49</table>56</table>
@@ -171,6 +171,10 @@ sections:
171 href: ./instance_time.md171 href: ./instance_time.md
172 - label: GLOBAL_INSTANCE_TIME172 - label: GLOBAL_INSTANCE_TIME
173 href: ./global_instance_time.md173 href: ./global_instance_time.md
174+ - label: DATABASE_SQL_STAT
175+ href: ./database_sql_stat.md
176+ - label: SUMMARY_DATABASE_SQL_STAT
177+ href: ./summary_database_sql_stat.md
174 - label: Memory178 - label: Memory
175 sections:179 sections:
176 - label: MEMORY_NODE_DETAIL180 - label: MEMORY_NODE_DETAIL
@@ -0,0 +1,18 @@
1+# DATABASE\_SQL\_STAT
2+ 
3+Records per-database SQL execution statistics on the current node. Counters are accumulated on the Unique SQL completion path. Unique SQL must be enabled; otherwise the counters do not increase.
4+ 
5+**Table 1** DATABASE\_SQL\_STAT columns
6+ 
7+<table><thead align="left"><tr>
8+<th class="cellrowborder" valign="top" width="17.27%"><p><strong>Name</strong></p></th>
9+<th class="cellrowborder" valign="top" width="16.8%"><p><strong>Type</strong></p></th>
10+<th class="cellrowborder" valign="top" width="65.93%"><p><strong>Description</strong></p></th>
11+</tr></thead>
12+<tbody>
13+<tr><td class="cellrowborder" valign="top"><p>node_name</p></td><td class="cellrowborder" valign="top"><p>text</p></td><td class="cellrowborder" valign="top"><p>Node name.</p></td></tr>
14+<tr><td class="cellrowborder" valign="top"><p>datid</p></td><td class="cellrowborder" valign="top"><p>oid</p></td><td class="cellrowborder" valign="top"><p>Database OID.</p></td></tr>
15+<tr><td class="cellrowborder" valign="top"><p>datname</p></td><td class="cellrowborder" valign="top"><p>name</p></td><td class="cellrowborder" valign="top"><p>Database name.</p></td></tr>
16+<tr><td class="cellrowborder" valign="top"><p>n_calls</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>Cumulative SQL execution count for the database.</p></td></tr>
17+<tr><td class="cellrowborder" valign="top"><p>total_elapse_time</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>Cumulative SQL elapsed time for the database (microseconds).</p></td></tr>
18+</tbody></table>
@@ -41,5 +41,12 @@
41<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0283136564_en-us_topic_0237122558_p1180114397349"><a name="en-us_topic_0283136564_en-us_topic_0237122558_p1180114397349"></a><a name="en-us_topic_0283136564_en-us_topic_0237122558_p1180114397349"></a>Duration (unit: μs)</p>41<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0283136564_en-us_topic_0237122558_p1180114397349"><a name="en-us_topic_0283136564_en-us_topic_0237122558_p1180114397349"></a><a name="en-us_topic_0283136564_en-us_topic_0237122558_p1180114397349"></a>Duration (unit: μs)</p>
42</td>42</td>
43</tr>43</tr>
44+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
45+</td>
46+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
47+</td>
48+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>Cumulative call count for the corresponding time type (used by protocol-message statistics deltas).</p>
49+</td>
50+</tr>
44</tbody>51</tbody>
45</table>52</table>
@@ -60,5 +60,12 @@
60<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0283136931_en-us_topic_0237122557_p125797399330"><a name="en-us_topic_0283136931_en-us_topic_0237122557_p125797399330"></a><a name="en-us_topic_0283136931_en-us_topic_0237122557_p125797399330"></a>Time value (unit: μs)</p>60<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0283136931_en-us_topic_0237122557_p125797399330"><a name="en-us_topic_0283136931_en-us_topic_0237122557_p125797399330"></a><a name="en-us_topic_0283136931_en-us_topic_0237122557_p125797399330"></a>Time value (unit: μs)</p>
61</td>61</td>
62</tr>62</tr>
63+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
64+</td>
65+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
66+</td>
67+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>Cumulative call count for the corresponding time type (used by protocol-message statistics deltas).</p>
68+</td>
69+</tr>
63</tbody>70</tbody>
64</table>71</table>
@@ -33,3 +33,20 @@ The following table lists metrics in the Memory Statistics report.
33</tr>33</tr>
34</tbody>34</tbody>
35</table>35</table>
36+## Shared Memory Statistics
37+ 
38+Shows the Top 10 shared-memory candidate components by size at the end snapshot, plus a (Total) row. The percentage denominator is max_shared_memory. Node-wide report, which can be viewed in node mode for summary or all report types.
39+ 
40+Candidates: Buffer Blocks, Buffer Descriptors, Buffer Descriptors Extra, Checkpoint BufferIds, clog, XLOG Ctl, CSNLOG Ctl, PgStat, AshContext, IncreCheckPointContext, Undo, imcstore context, and DoubleWriteContext.
41+ 
42+Data sources: snapshot.snap_global_shared_memory_detail and snapshot.snap_global_memory_node_detail.
43+ 
44+**Table 2 Columns in Shared Memory Statistics**
45+ 
46+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>Column</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>Description</strong></p></th></tr></thead>
47+<tbody>
48+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Shared Memory</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Shared-memory component name. Includes (Total) and the Top 10 candidates by size.</p></td></tr>
49+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Size</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Component size (MB or GB). The (Total) row is max_shared_memory.</p></td></tr>
50+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Pct(%)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Percentage relative to max_shared_memory; (Total) is 100%.</p></td></tr>
51+</tbody>
52+</table>
@@ -1,6 +1,6 @@
1# Object stats<a name="EN-US_TOPIC_0000001260195075"></a>1# Object stats<a name="EN-US_TOPIC_0000001260195075"></a>
2 2 
3-Object stats contains three tables: User Tables stats, User index stats, and Bad lock stats. Columns in the tables are described as follows:3+Object stats contains four tables: User Tables stats, User index stats, Bad lock stats, and Unused Indexes. Columns in the tables are described as follows:
4 4 
5## User Tables stats<a name="section155172118496"></a>5## User Tables stats<a name="section155172118496"></a>
6 6 
@@ -218,3 +218,18 @@ Object stats contains three tables: User Tables stats, User index stats, and Bad
218</tr>218</tr>
219</tbody>219</tbody>
220</table>220</table>
221+## Unused Indexes
222+ 
223+Lists user indexes whose idx_scan delta between the begin and end snapshots is 0 (system schemas excluded, same rule as User index stats). Database/Node-wide report, which can be viewed in cluster or node mode for detail or all report types, up to 200 rows.
224+ 
225+**Table 4 Columns in Unused Indexes**
226+ 
227+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>Column</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>Description</strong></p></th></tr></thead>
228+<tbody>
229+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>DB Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Database name.</p></td></tr>
230+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Schema</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Schema name.</p></td></tr>
231+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Table Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Table name.</p></td></tr>
232+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Index Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Index name.</p></td></tr>
233+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Total Index Scans</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Cumulative index scan count at the end snapshot (not a delta).</p></td></tr>
234+</tbody>
235+</table>
@@ -143,3 +143,22 @@ The following table describes columns in the SQL Statistics report.
143</tr>143</tr>
144</tbody>144</tbody>
145</table>145</table>
146+## SQL Stats by Database
147+ 
148+Aggregates Unique SQL completion-path execution count and elapsed time by database, and computes the percentage of instance DB_TIME. Node-wide report, which can be viewed in node mode for detail or all report types. Unique SQL must be enabled.
149+ 
150+Data source: snapshot.snap_summary_database_sql_stat (from dbe_perf.summary_database_sql_stat / dbe_perf.database_sql_stat).
151+ 
152+**Table 2 Columns in SQL Stats by Database**
153+ 
154+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>Column</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>Description</strong></p></th></tr></thead>
155+<tbody>
156+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>DB Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Database name.</p></td></tr>
157+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Exec Count</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Execution-count delta for the database between snapshots.</p></td></tr>
158+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Total Time(s)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Total elapsed time in seconds.</p></td></tr>
159+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Avg Time(ms)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Average elapsed time in milliseconds; 0 when Exec Count is 0.</p></td></tr>
160+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>% of DB Time</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Percentage of the instance DB_TIME delta.</p></td></tr>
161+</tbody>
162+</table>
163+ 
164+Only databases with Exec Count or elapsed-time delta greater than 0 are listed, ordered by Total Time descending.
@@ -0,0 +1,18 @@
1+# SUMMARY\_DATABASE\_SQL\_STAT
2+ 
3+Provides per-database SQL execution statistics from all healthy nodes in openGauss (see [DATABASE\_SQL\_STAT](database_sql_stat.md) for column meanings). Aggregated by `dbe_perf.get_summary_database_sql_stat()` from each node's `database_sql_stat`, and used as the source of the WDR snapshot table `snap_summary_database_sql_stat`.
4+ 
5+**Table 1** SUMMARY\_DATABASE\_SQL\_STAT columns
6+ 
7+<table><thead align="left"><tr>
8+<th class="cellrowborder" valign="top" width="17.27%"><p><strong>Name</strong></p></th>
9+<th class="cellrowborder" valign="top" width="16.8%"><p><strong>Type</strong></p></th>
10+<th class="cellrowborder" valign="top" width="65.93%"><p><strong>Description</strong></p></th>
11+</tr></thead>
12+<tbody>
13+<tr><td class="cellrowborder" valign="top"><p>node_name</p></td><td class="cellrowborder" valign="top"><p>text</p></td><td class="cellrowborder" valign="top"><p>Node name.</p></td></tr>
14+<tr><td class="cellrowborder" valign="top"><p>datid</p></td><td class="cellrowborder" valign="top"><p>oid</p></td><td class="cellrowborder" valign="top"><p>Database OID.</p></td></tr>
15+<tr><td class="cellrowborder" valign="top"><p>datname</p></td><td class="cellrowborder" valign="top"><p>name</p></td><td class="cellrowborder" valign="top"><p>Database name.</p></td></tr>
16+<tr><td class="cellrowborder" valign="top"><p>n_calls</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>Cumulative SQL execution count for the database.</p></td></tr>
17+<tr><td class="cellrowborder" valign="top"><p>total_elapse_time</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>Cumulative SQL elapsed time for the database (microseconds).</p></td></tr>
18+</tbody></table>
@@ -63,3 +63,43 @@ The following table describes metrics in the Time Model report.
63</tr>63</tr>
64</tbody>64</tbody>
65</table>65</table>
66+## Protocol Message Statistics
67+ 
68+In the WDR report, the module title is **Protocol Statistics** and the table title is **Protocol Message Statistics**.
69+ 
70+Aggregates execution count and elapsed time by protocol message type between snapshots, and computes the percentage of instance DB_TIME. Data comes from `snapshot.snap_global_instance_time` (`snap_value` / `snap_n_calls`), the same source as Time Model. Node-wide report, which can be viewed in node mode for detail or all report types.
71+ 
72+**Table 2 Protocol message type mapping**
73+ 
74+<table><thead align="left"><tr>
75+<th class="cellrowborder" valign="top" width="8%" id="h0"><p><strong>No.</strong></p></th>
76+<th class="cellrowborder" valign="top" width="22%" id="h1"><p><strong>Report name (Message Type)</strong></p></th>
77+<th class="cellrowborder" valign="top" width="28%" id="h2"><p><strong>Internal stat_name</strong></p></th>
78+<th class="cellrowborder" valign="top" width="42%" id="h3"><p><strong>Meaning</strong></p></th>
79+</tr></thead>
80+<tbody>
81+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>1</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Simple Query</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT2_SIMPLE_QUERY</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Simple-query protocol path (Q message): elapsed time and execution count</p></td></tr>
82+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>2</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Parse</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT6_P</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Parse phase</p></td></tr>
83+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>3</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Bind</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT7_B</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Bind phase</p></td></tr>
84+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>4</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Execute</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT8_E</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Execute phase</p></td></tr>
85+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>5</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Describe</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT9_D</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Describe phase</p></td></tr>
86+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>6</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Sync</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT10_S</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Sync phase</p></td></tr>
87+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>7</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Close</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT11_C</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Close phase</p></td></tr>
88+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>8</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Batch Bind-Execute</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT12_U</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Batch Bind-Execute path (U message): elapsed time and execution count</p></td></tr>
89+</tbody>
90+</table>
91+ 
92+ 
93+**Table 3 Columns in Protocol Message Statistics**
94+ 
95+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>Column</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>Description</strong></p></th></tr></thead>
96+<tbody>
97+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Message Type</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Protocol message type (see the mapping above).</p></td></tr>
98+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Exec Count</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Execution-count delta between snapshots (end − begin n_calls).</p></td></tr>
99+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Total Time(s)</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Total elapsed time in seconds (converted from microsecond delta).</p></td></tr>
100+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Avg Time(ms)</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Average elapsed time in milliseconds; 0 when Exec Count is 0.</p></td></tr>
101+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>% of DB Time</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Percentage of the instance DB_TIME delta.</p></td></tr>
102+</tbody>
103+</table>
104+ 
105+Rows are ordered by Total Time descending. Exec Count and elapsed time may be 0 when there is no activity for that message type.
@@ -3,3 +3,8 @@
3The naming rule of a WDR snapshot data table is **snap\_**_\{Source data table\}_.3The naming rule of a WDR snapshot data table is **snap\_**_\{Source data table\}_.
4 4 
5WDR snapshot data tables come from all views in [DBE\_PERF Schema](dbe_perf_schema.md).5WDR snapshot data tables come from all views in [DBE\_PERF Schema](dbe_perf_schema.md).
6+ 
7+Related additions/extensions for this feature:
8+ 
9+- `snap_global_instance_time` adds `snap_n_calls`, corresponding to `n_calls` of `pv_instance_time` / `dbe_perf.instance_time`, used by Protocol Message Statistics deltas.
10+- New table `snap_summary_database_sql_stat` is sourced from `dbe_perf.summary_database_sql_stat` and used by SQL Stats by Database.
@@ -48,7 +48,7 @@ The following table describes the WDR content of the openGauss database.
48</tr>48</tr>
49<tr id="row1212013312166"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p7991716336"><a name="p7991716336"></a><a name="p7991716336"></a><a href="memory_statistics.md">Memory Statistics</a></p>49<tr id="row1212013312166"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p7991716336"><a name="p7991716336"></a><a name="p7991716336"></a><a href="memory_statistics.md">Memory Statistics</a></p>
50</td>50</td>
51-<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul4459131414205"></a><a name="ul4459131414205"></a><ul id="ul4459131414205"><li>Kernel memory usage.</li><li>Node-wide report, which can be viewed in node mode.</li></ul>51+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul4459131414205"></a><a name="ul4459131414205"></a><ul id="ul4459131414205"><li>Kernel memory usage and key shared-memory component sizes and percentages.</li><li>Node-wide report, which can be viewed in node mode.</li></ul>
52</td>52</td>
53</tr>53</tr>
54<tr id="row1213317120167"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p1316142615558"><a name="p1316142615558"></a><a name="p1316142615558"></a><a href="time_model.md">Time Model</a></p>54<tr id="row1213317120167"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p1316142615558"><a name="p1316142615558"></a><a name="p1316142615558"></a><a href="time_model.md">Time Model</a></p>
@@ -56,6 +56,11 @@ The following table describes the WDR content of the openGauss database.
56<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul16141716192014"></a><a name="ul16141716192014"></a><ul id="ul16141716192014"><li>Time distribution information about the statements in a node.</li><li>Node-wide report, which can be viewed in node mode.</li></ul>56<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul16141716192014"></a><a name="ul16141716192014"></a><ul id="ul16141716192014"><li>Time distribution information about the statements in a node.</li><li>Node-wide report, which can be viewed in node mode.</li></ul>
57</td>57</td>
58</tr>58</tr>
59+<tr id="row-protocol-message-stat"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p><a href="time_model.md#protocol-message-statistics">Protocol Statistics</a></p>
60+</td>
61+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><ul><li>Execution count, elapsed time, and % of DB Time by protocol message type (Simple Query / Parse / Bind / Execute / Describe / Sync / Close / Batch Bind-Execute).</li><li>Node-wide report, which can be viewed in node mode for detail or all report types.</li></ul>
62+</td>
63+</tr>
59<tr id="row849110591151"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p148180593320"><a name="p148180593320"></a><a name="p148180593320"></a><a href="sql_statistics.md">SQL Statistics</a></p>64<tr id="row849110591151"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p148180593320"><a name="p148180593320"></a><a name="p148180593320"></a><a href="sql_statistics.md">SQL Statistics</a></p>
60</td>65</td>
61<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul275315279205"></a><a name="ul275315279205"></a><ul id="ul275315279205"><li>SQL statement performance statistics: end-to-end time, row activities, cache hit, CPU consumption, and time consumption.</li><li>Database/Node-wide report, which can be viewed in cluster or node mode.</li></ul>66<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul275315279205"></a><a name="ul275315279205"></a><ul id="ul275315279205"><li>SQL statement performance statistics: end-to-end time, row activities, cache hit, CPU consumption, and time consumption.</li><li>Database/Node-wide report, which can be viewed in cluster or node mode.</li></ul>
@@ -78,7 +83,7 @@ The following table describes the WDR content of the openGauss database.
78</tr>83</tr>
79<tr id="row156411451131512"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p12651331239"><a name="p12651331239"></a><a name="p12651331239"></a><a href="object_stats.md">Object stats</a></p>84<tr id="row156411451131512"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p12651331239"><a name="p12651331239"></a><a name="p12651331239"></a><a href="object_stats.md">Object stats</a></p>
80</td>85</td>
81-<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul8257222112020"></a><a name="ul8257222112020"></a><ul id="ul8257222112020"><li>Performance statistics on the index and table dimensions.</li><li>Database/Node-wide report, which can be viewed in cluster or node mode.</li></ul>86+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul8257222112020"></a><a name="ul8257222112020"></a><ul id="ul8257222112020"><li>Performance statistics on the index and table dimensions, and unused user indexes in the snapshot interval.</li><li>Database/Node-wide report, which can be viewed in cluster or node mode.</li></ul>
82</td>87</td>
83</tr>88</tr>
84<tr id="row8845174912158"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p14537204613311"><a name="p14537204613311"></a><a name="p14537204613311"></a><a href="configuration_settings.md">Configuration settings</a></p>89<tr id="row8845174912158"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p14537204613311"><a name="p14537204613311"></a><a name="p14537204613311"></a><a href="configuration_settings.md">Configuration settings</a></p>
@@ -1,8 +1,8 @@
1-# 支持WDR诊断报告<a name="ZH-CN_TOPIC_0000001105235298"></a>1+# 支持WDR诊断报告
2 2 
3## 可获得性<a name="section11239174173316"></a>3## 可获得性<a name="section11239174173316"></a>
4 4 
5-本特性自openGauss 1.0.0版本开始引入。5+本特性自openGauss 1.0.0 版本开始引入。
6 6 
7## 特性简介<a name="section2238114973310"></a>7## 特性简介<a name="section2238114973310"></a>
8 8 
@@ -42,7 +42,7 @@ WDR主要依赖两个组件:
42<tr id="row589614018168"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p2896170181618"><a name="p2896170181618"></a><a name="p2896170181618"></a>Load Profile</p>42<tr id="row589614018168"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p2896170181618"><a name="p2896170181618"></a><a name="p2896170181618"></a>Load Profile</p>
43</td>43</td>
44<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p2089612013161"><a name="p2089612013161"></a><a name="p2089612013161"></a>从时间,IO,事务,SQL几个维度评估当前系统负载的表现。</p>44<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p2089612013161"><a name="p2089612013161"></a><a name="p2089612013161"></a>从时间,IO,事务,SQL几个维度评估当前系统负载的表现。</p>
45-<p id="p161691350122212"><a name="p161691350122212"></a><a name="p161691350122212"></a>包含作业运行elapse time、CPU time,事务日志量,逻辑和物理读的量,读写IO次数、大小,登入登出次数,SQL、事务执行量,SQL P80、P95响应时间等。</p>45+<p id="p161691350122212"><a name="p161691350122212"></a><a name="p161691350122212"></a>包含作业运行elapse time、CPU time,事务日质量,逻辑和物理读的量,读写IO次数、大小,登入登出次数,SQL、事务执行量,SQL P80、P95响应时间等。</p>
46</td>46</td>
47</tr>47</tr>
48<tr id="row889614011167"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p11896801161"><a name="p11896801161"></a><a name="p11896801161"></a>Instance Efficiency Percentages</p>48<tr id="row889614011167"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p11896801161"><a name="p11896801161"></a><a name="p11896801161"></a>Instance Efficiency Percentages</p>
@@ -75,7 +75,7 @@ WDR主要依赖两个组件:
75</tr>75</tr>
76<tr id="row123476454170"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p934714512178"><a name="p934714512178"></a><a name="p934714512178"></a>Memory Statistics</p>76<tr id="row123476454170"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p934714512178"><a name="p934714512178"></a><a name="p934714512178"></a>Memory Statistics</p>
77</td>77</td>
78-<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p434712455175"><a name="p434712455175"></a><a name="p434712455175"></a>包含最大进程内存、进程已经使用内存、最大共享内存、已经使用共享内存大小等。</p>78+<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p434712455175"><a name="p434712455175"></a><a name="p434712455175"></a>包含最大进程内存、进程已经使用内存、最大共享内存、已经使用共享内存大小,以及关键共享内存组件占用与占比等。</p>
79</td>79</td>
80</tr>80</tr>
81</tbody>81</tbody>
@@ -96,10 +96,16 @@ WDR主要依赖两个组件:
96<p id="p33332484313"><a name="p33332484313"></a><a name="p33332484313"></a>包含系统在各个阶段上消耗的时间:内核时间、CPU时间、执行时间、解析时间、编译时间、查询重写时间、计划生成时间、网络时间、IO时间。</p>96<p id="p33332484313"><a name="p33332484313"></a><a name="p33332484313"></a>包含系统在各个阶段上消耗的时间:内核时间、CPU时间、执行时间、解析时间、编译时间、查询重写时间、计划生成时间、网络时间、IO时间。</p>
97</td>97</td>
98</tr>98</tr>
99+<tr id="row-protocol-statistics"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p>Protocol Statistics</p>
100+</td>
101+<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p>按协议报文类型统计执行次数与耗时。</p>
102+<p>包含 Simple Query、Parse、Bind、Execute、Describe、Sync、Close、Batch Bind-Execute 的 Exec Count、Total Time(s)、Avg Time(ms)、% of DB Time。</p>
103+</td>
104+</tr>
99<tr id="row1233374883113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p10333948163119"><a name="p10333948163119"></a><a name="p10333948163119"></a>SQL Statistics</p>105<tr id="row1233374883113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p10333948163119"><a name="p10333948163119"></a><a name="p10333948163119"></a>SQL Statistics</p>
100</td>106</td>
101<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p367217315715"><a name="p367217315715"></a><a name="p367217315715"></a>主要用于SQL语句性能问题的诊断。</p>107<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p367217315715"><a name="p367217315715"></a><a name="p367217315715"></a>主要用于SQL语句性能问题的诊断。</p>
102-<p id="p103331848113117"><a name="p103331848113117"></a><a name="p103331848113117"></a>包含归一化的SQL的性能指标在多个维度上的排序:Elapsed Time、CPU Time、Rows Returned、Tuples Reads、Executions、Physical Reads、Logical Reads。这些指标的种类包括:执行时间、执行次数、行活动、Cache IO等。</p>108+<p id="p103331848113117"><a name="p103331848113117"></a><a name="p103331848113117"></a>包含归一化的SQL的性能指标在多个维度上的排序:Elapsed Time、CPU Time、Rows Returned、Tuples Reads、Executions、Physical Reads、Logical Reads。这些指标的种类包括:执行时间,执行次数、行活动、Cache IO等。另包含按数据库聚合的执行次数与耗时。</p>
103</td>109</td>
104</tr>110</tr>
105<tr id="row1933324873111"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p183331348193119"><a name="p183331348193119"></a><a name="p183331348193119"></a>Wait Events</p>111<tr id="row1933324873111"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p183331348193119"><a name="p183331348193119"></a><a name="p183331348193119"></a>Wait Events</p>
@@ -123,7 +129,7 @@ WDR主要依赖两个组件:
123<tr id="row123341448113113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p11334848143110"><a name="p11334848143110"></a><a name="p11334848143110"></a>Object stats</p>129<tr id="row123341448113113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p11334848143110"><a name="p11334848143110"></a><a name="p11334848143110"></a>Object stats</p>
124</td>130</td>
125<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p14405135119915"><a name="p14405135119915"></a><a name="p14405135119915"></a>用于诊断数据库对象的性能。</p>131<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p14405135119915"><a name="p14405135119915"></a><a name="p14405135119915"></a>用于诊断数据库对象的性能。</p>
126-<p id="p6334174863119"><a name="p6334174863119"></a><a name="p6334174863119"></a>包含用户表、索引上的表、索引扫描活动,insert、update、delete活动,有效行数量,表维护操作的状态等。</p>132+<p id="p6334174863119"><a name="p6334174863119"></a><a name="p6334174863119"></a>包含用户表、索引上的表、索引扫描活动,insert、update、delete活动,有效行数量,表维护操作的状态,以及区间内未使用的用户索引等。</p>
127</td>133</td>
128</tr>134</tr>
129<tr id="row1427793219359"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p32775326355"><a name="p32775326355"></a><a name="p32775326355"></a>Configuration settings</p>135<tr id="row1427793219359"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p32775326355"><a name="p32775326355"></a><a name="p32775326355"></a>Configuration settings</p>
@@ -142,7 +148,10 @@ WDR主要依赖两个组件:
142 148 
143## 特性增强<a name="section9602018103411"></a>149## 特性增强<a name="section9602018103411"></a>
144 150 
145-无。151+- Shared Memory Statistics:展示共享内存候选组件中按大小排序的Top 10及(Total)。节点范围报表,仅node模式下的summary或all报告可查看。
152+- Protocol Statistics(Protocol Message Statistics):按 8 种协议报文类型统计 Exec Count、Total Time(s)、Avg Time(ms)、% of DB Time。节点范围报表,仅 node 模式下的 detail 或 all 报告可查看。
153+- SQL Stats by Database:按数据库聚合SQL执行次数与耗时。节点范围报表,仅node模式下的detail或all报告可查看。
154+- Unused Indexes:输出区间内未使用的用户索引。数据库、节点范围报表,cluster模式和node模式下的detail或all报告可查看。
146 155 
147## 特性约束<a name="section1956417145819"></a>156## 特性约束<a name="section1956417145819"></a>
148 157 
@@ -60,5 +60,12 @@
60<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"><a name="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"></a><a name="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"></a>时间值(单位:微秒)。</p>60<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"><a name="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"></a><a name="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"></a>时间值(单位:微秒)。</p>
61</td>61</td>
62</tr>62</tr>
63+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
64+</td>
65+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
66+</td>
67+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>对应时间类型的累计调用次数(协议报文类统计等依赖此字段差分)。</p>
68+</td>
69+</tr>
63</tbody>70</tbody>
64</table>71</table>
@@ -207,6 +207,10 @@ sections:
207 href: ./instance_time.md 207 href: ./instance_time.md
208 - label: GLOBAL_INSTANCE_TIME208 - label: GLOBAL_INSTANCE_TIME
209 href: ./global_instance_time.md209 href: ./global_instance_time.md
210+ - label: DATABASE_SQL_STAT
211+ href: ./database_sql_stat.md
212+ - label: SUMMARY_DATABASE_SQL_STAT
213+ href: ./summary_database_sql_stat.md
210 - label: Memory214 - label: Memory
211 sections:215 sections:
212 - label: MEMORY_NODE_DETAIL216 - label: MEMORY_NODE_DETAIL
@@ -0,0 +1,18 @@
1+# DATABASE\_SQL\_STAT
2+ 
3+提供当前节点按数据库聚合的SQL执行统计(在Unique SQL完成路径上累计)。需开启Unique SQL相关能力,否则计数不增长。
4+ 
5+**表 1** DATABASE\_SQL\_STAT字段
6+ 
7+<table><thead align="left"><tr>
8+<th class="cellrowborder" valign="top" width="17.27%"><p><strong>名称</strong></p></th>
9+<th class="cellrowborder" valign="top" width="16.8%"><p><strong>类型</strong></p></th>
10+<th class="cellrowborder" valign="top" width="65.93%"><p><strong>描述</strong></p></th>
11+</tr></thead>
12+<tbody>
13+<tr><td class="cellrowborder" valign="top"><p>node_name</p></td><td class="cellrowborder" valign="top"><p>text</p></td><td class="cellrowborder" valign="top"><p>节点名称。</p></td></tr>
14+<tr><td class="cellrowborder" valign="top"><p>datid</p></td><td class="cellrowborder" valign="top"><p>oid</p></td><td class="cellrowborder" valign="top"><p>数据库OID。</p></td></tr>
15+<tr><td class="cellrowborder" valign="top"><p>datname</p></td><td class="cellrowborder" valign="top"><p>name</p></td><td class="cellrowborder" valign="top"><p>数据库名称。</p></td></tr>
16+<tr><td class="cellrowborder" valign="top"><p>n_calls</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>该库累计SQL执行次数。</p></td></tr>
17+<tr><td class="cellrowborder" valign="top"><p>total_elapse_time</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>该库累计SQL总耗时(微秒)。</p></td></tr>
18+</tbody></table>
@@ -41,5 +41,12 @@
41<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0283136564_zh-cn_topic_0237122558_p1180114397349"><a name="zh-cn_topic_0283136564_zh-cn_topic_0237122558_p1180114397349"></a><a name="zh-cn_topic_0283136564_zh-cn_topic_0237122558_p1180114397349"></a>时间值(单位:微秒)。</p>41<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0283136564_zh-cn_topic_0237122558_p1180114397349"><a name="zh-cn_topic_0283136564_zh-cn_topic_0237122558_p1180114397349"></a><a name="zh-cn_topic_0283136564_zh-cn_topic_0237122558_p1180114397349"></a>时间值(单位:微秒)。</p>
42</td>42</td>
43</tr>43</tr>
44+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
45+</td>
46+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
47+</td>
48+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>对应时间类型的累计调用次数(协议报文类统计等依赖此字段差分)。</p>
49+</td>
50+</tr>
44</tbody>51</tbody>
45</table>52</table>
@@ -60,5 +60,12 @@
60<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0283136931_zh-cn_topic_0237122557_p125797399330"><a name="zh-cn_topic_0283136931_zh-cn_topic_0237122557_p125797399330"></a><a name="zh-cn_topic_0283136931_zh-cn_topic_0237122557_p125797399330"></a>时间值(单位:微秒)。</p>60<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0283136931_zh-cn_topic_0237122557_p125797399330"><a name="zh-cn_topic_0283136931_zh-cn_topic_0237122557_p125797399330"></a><a name="zh-cn_topic_0283136931_zh-cn_topic_0237122557_p125797399330"></a>时间值(单位:微秒)。</p>
61</td>61</td>
62</tr>62</tr>
63+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
64+</td>
65+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
66+</td>
67+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>对应时间类型的累计调用次数(协议报文类统计等依赖此字段差分)。</p>
68+</td>
69+</tr>
63</tbody>70</tbody>
64</table>71</table>
@@ -33,3 +33,20 @@ Memory Statistics指标名称及描述如下表所示。
33</tr>33</tr>
34</tbody>34</tbody>
35</table>35</table>
36+## Shared Memory Statistics
37+ 
38+展示结束快照时刻共享内存候选组件中按占用大小排序的Top 10及(Total)行。占比分母为max_shared_memory。节点范围报表,仅node模式下的summary或all报告可查看。
39+ 
40+候选组件包括:Buffer Blocks、Buffer Descriptors、Buffer Descriptors Extra、Checkpoint BufferIds、clog、XLOG Ctl、CSNLOG Ctl、PgStat、AshContext、IncreCheckPointContext、Undo、imcstore context、DoubleWriteContext。
41+ 
42+数据来源:snapshot.snap_global_shared_memory_detail、snapshot.snap_global_memory_node_detail。
43+ 
44+**表 2 Shared Memory Statistics报表主要内容**
45+ 
46+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>列名称</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>描述</strong></p></th></tr></thead>
47+<tbody>
48+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Shared Memory</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>共享内存组件名称。含(Total)以及候选组件中按大小排序的Top 10。</p></td></tr>
49+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Size</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>组件占用大小(MB或GB)。(Total)行为max_shared_memory。</p></td></tr>
50+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Pct(%)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>相对max_shared_memory的占比;(Total)为100%。</p></td></tr>
51+</tbody>
52+</table>
@@ -1,6 +1,6 @@
1# Object stats<a name="ZH-CN_TOPIC_0000001260195075"></a>1# Object stats<a name="ZH-CN_TOPIC_0000001260195075"></a>
2 2 
3-Object stats包含User Tables stats、User index stats和Bad lock stats三张表,列名称及描述如下所示。3+Object stats包含User Tables stats、User index stats、Bad lock stats和Unused Indexes四张表,列名称及描述如下所示。
4 4 
5## User Tables stats<a name="section155172118496"></a>5## User Tables stats<a name="section155172118496"></a>
6 6 
@@ -218,3 +218,18 @@ Object stats包含User Tables stats、User index stats和Bad lock stats三张表
218</tr>218</tr>
219</tbody>219</tbody>
220</table>220</table>
221+## Unused Indexes
222+ 
223+筛选begin/end快照之间idx_scan增量为0的用户索引(排除系统schema,与User index stats相同规则)。数据库、节点范围报表,cluster模式和node模式下的detail或all报告可查看,最多200行。
224+ 
225+**表 4 Unused Indexes报表主要内容**
226+ 
227+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>列名称</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>描述</strong></p></th></tr></thead>
228+<tbody>
229+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>DB Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Database名称。</p></td></tr>
230+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Schema</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Schema名称。</p></td></tr>
231+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Table Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>表名称。</p></td></tr>
232+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Index Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>索引名称。</p></td></tr>
233+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Total Index Scans</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>结束快照时刻的累计索引扫描次数(非区间差分)。</p></td></tr>
234+</tbody>
235+</table>
@@ -143,3 +143,22 @@ SQL Statistics列名称及描述如下表所示。
143</tr>143</tr>
144</tbody>144</tbody>
145</table>145</table>
146+## SQL Stats by Database
147+ 
148+按数据库聚合Unique SQL完成路径上的执行次数与总耗时,并计算占实例DB_TIME的比例。节点范围报表,仅node模式下的detail或all报告可查看。需开启Unique SQL相关能力。
149+ 
150+数据来源:snapshot.snap_summary_database_sql_stat(由dbe_perf.summary_database_sql_stat / dbe_perf.database_sql_stat采集)。
151+ 
152+**表 2 SQL Stats by Database报表主要内容**
153+ 
154+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>列名称</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>描述</strong></p></th></tr></thead>
155+<tbody>
156+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>DB Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>数据库名称。</p></td></tr>
157+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Exec Count</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>区间内该库SQL执行次数差分。</p></td></tr>
158+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Total Time(s)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>区间内总耗时(秒)。</p></td></tr>
159+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Avg Time(ms)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>平均耗时(毫秒);Exec Count为0时为0。</p></td></tr>
160+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>% of DB Time</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>相对实例DB_TIME差分的百分比。</p></td></tr>
161+</tbody>
162+</table>
163+ 
164+仅输出Exec Count或总耗时差分大于0的库,按Total Time降序排列。
@@ -0,0 +1,18 @@
1+# SUMMARY\_DATABASE\_SQL\_STAT
2+ 
3+提供openGauss中各正常节点按数据库聚合的SQL执行统计(字段含义见[DATABASE\_SQL\_STAT](database_sql_stat.md))。数据由`dbe_perf.get_summary_database_sql_stat()`汇总各节点`database_sql_stat`得到,是WDR快照表`snap_summary_database_sql_stat`的采集来源。
4+ 
5+**表 1** SUMMARY\_DATABASE\_SQL\_STAT字段
6+ 
7+<table><thead align="left"><tr>
8+<th class="cellrowborder" valign="top" width="17.27%"><p><strong>名称</strong></p></th>
9+<th class="cellrowborder" valign="top" width="16.8%"><p><strong>类型</strong></p></th>
10+<th class="cellrowborder" valign="top" width="65.93%"><p><strong>描述</strong></p></th>
11+</tr></thead>
12+<tbody>
13+<tr><td class="cellrowborder" valign="top"><p>node_name</p></td><td class="cellrowborder" valign="top"><p>text</p></td><td class="cellrowborder" valign="top"><p>节点名称。</p></td></tr>
14+<tr><td class="cellrowborder" valign="top"><p>datid</p></td><td class="cellrowborder" valign="top"><p>oid</p></td><td class="cellrowborder" valign="top"><p>数据库OID。</p></td></tr>
15+<tr><td class="cellrowborder" valign="top"><p>datname</p></td><td class="cellrowborder" valign="top"><p>name</p></td><td class="cellrowborder" valign="top"><p>数据库名称。</p></td></tr>
16+<tr><td class="cellrowborder" valign="top"><p>n_calls</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>该库累计SQL执行次数。</p></td></tr>
17+<tr><td class="cellrowborder" valign="top"><p>total_elapse_time</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>该库累计SQL总耗时(微秒)。</p></td></tr>
18+</tbody></table>
@@ -144,3 +144,43 @@ Time Model名称及描述如下表所示。
144</tr>144</tr>
145</tbody>145</tbody>
146</table>146</table>
147+## Protocol Message Statistics
148+ 
149+WDR 报告中对应模块标题为 **Protocol Statistics**,表标题为 **Protocol Message Statistics**。
150+ 
151+按协议报文类型统计 begin/end 快照区间内的执行次数与耗时,并计算占实例 DB_TIME 的比例。数据来自 `snapshot.snap_global_instance_time`(`snap_value` / `snap_n_calls`),与 Time Model 同源。节点范围报表,仅 node 模式下的 detail 或 all 报告可查看。
152+ 
153+**表 2 协议报文类型映射**
154+ 
155+<table><thead align="left"><tr>
156+<th class="cellrowborder" valign="top" width="8%" id="h0"><p><strong>序号</strong></p></th>
157+<th class="cellrowborder" valign="top" width="22%" id="h1"><p><strong>报告显示名(Message Type)</strong></p></th>
158+<th class="cellrowborder" valign="top" width="28%" id="h2"><p><strong>内部 stat_name</strong></p></th>
159+<th class="cellrowborder" valign="top" width="42%" id="h3"><p><strong>组件含义</strong></p></th>
160+</tr></thead>
161+<tbody>
162+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>1</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Simple Query</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT2_SIMPLE_QUERY</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>简单查询协议路径(Q 报文)耗时与执行次数</p></td></tr>
163+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>2</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Parse</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT6_P</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Parse 阶段</p></td></tr>
164+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>3</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Bind</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT7_B</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Bind 阶段</p></td></tr>
165+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>4</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Execute</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT8_E</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Execute 阶段</p></td></tr>
166+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>5</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Describe</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT9_D</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Describe 阶段</p></td></tr>
167+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>6</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Sync</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT10_S</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Sync 阶段</p></td></tr>
168+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>7</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Close</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT11_C</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Close 阶段</p></td></tr>
169+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>8</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Batch Bind-Execute</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT12_U</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>批量 Bind-Execute(U 报文)路径耗时与执行次数</p></td></tr>
170+</tbody>
171+</table>
172+ 
173+ 
174+**表 3 Protocol Message Statistics报表主要内容**
175+ 
176+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>列名称</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>描述</strong></p></th></tr></thead>
177+<tbody>
178+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Message Type</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>协议报文类型(见上表)。</p></td></tr>
179+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Exec Count</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>区间内该报文类型的执行次数差分(end − begin 的 n_calls)。</p></td></tr>
180+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Total Time(s)</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>区间内总耗时(秒,由微秒差分换算)。</p></td></tr>
181+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Avg Time(ms)</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>平均耗时(毫秒);Exec Count 为 0 时为 0。</p></td></tr>
182+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>% of DB Time</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>相对实例 DB_TIME 差分的百分比。</p></td></tr>
183+</tbody>
184+</table>
185+ 
186+按 Total Time 降序排列;无对应报文活动时 Exec Count / 耗时可为 0。
@@ -3,3 +3,8 @@
3WDR Snapshot数据表命名原则: snap\_\{源数据表\}。3WDR Snapshot数据表命名原则: snap\_\{源数据表\}。
4 4 
5WDR Snapshot数据表来源为[DBE\_PERF Schema](dbe_perf_schema.md)下的视图。5WDR Snapshot数据表来源为[DBE\_PERF Schema](dbe_perf_schema.md)下的视图。
6+ 
7+与本特性相关的新增/扩展说明:
8+ 
9+- `snap_global_instance_time` 增加 `snap_n_calls` 字段,对应 `pv_instance_time` / `dbe_perf.instance_time` 的 `n_calls`,供 Protocol Message Statistics 等差分统计使用。
10+- 新增 `snap_summary_database_sql_stat`,来源为 `dbe_perf.summary_database_sql_stat`,供 SQL Stats by Database 使用。
@@ -48,7 +48,7 @@ openGauss数据库WDR报表主要内容如下表所示。
48</tr>48</tr>
49<tr id="row1212013312166"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p7991716336"><a name="p7991716336"></a><a name="p7991716336"></a><a href="memory_statistics.md">Memory Statistics</a></p>49<tr id="row1212013312166"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p7991716336"><a name="p7991716336"></a><a name="p7991716336"></a><a href="memory_statistics.md">Memory Statistics</a></p>
50</td>50</td>
51-<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul4459131414205"></a><a name="ul4459131414205"></a><ul id="ul4459131414205"><li>内核内存使用分布。</li><li>节点范围报表,仅node模式下可查看此报表。</li></ul>51+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul4459131414205"></a><a name="ul4459131414205"></a><ul id="ul4459131414205"><li>内核内存使用分布,以及关键共享内存组件占用与占比。</li><li>节点范围报表,仅node模式下可查看此报表。</li></ul>
52</td>52</td>
53</tr>53</tr>
54<tr id="row1213317120167"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p1316142615558"><a name="p1316142615558"></a><a name="p1316142615558"></a><a href="time_model.md">Time Model</a></p>54<tr id="row1213317120167"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p1316142615558"><a name="p1316142615558"></a><a name="p1316142615558"></a><a href="time_model.md">Time Model</a></p>
@@ -56,6 +56,11 @@ openGauss数据库WDR报表主要内容如下表所示。
56<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul16141716192014"></a><a name="ul16141716192014"></a><ul id="ul16141716192014"><li>节点范围的语句的时间分布信息。</li><li>节点范围报表,仅node模式下可查看此报表。</li></ul>56<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul16141716192014"></a><a name="ul16141716192014"></a><ul id="ul16141716192014"><li>节点范围的语句的时间分布信息。</li><li>节点范围报表,仅node模式下可查看此报表。</li></ul>
57</td>57</td>
58</tr>58</tr>
59+<tr id="row-protocol-message-stat"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p><a href="time_model.md#protocol-message-statistics">Protocol Statistics</a></p>
60+</td>
61+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><ul><li>按协议报文类型(Simple Query / Parse / Bind / Execute / Describe / Sync / Close / Batch Bind-Execute)统计执行次数与耗时及占 DB_TIME 比例。</li><li>节点范围报表,仅node模式下的detail或all报告可查看。</li></ul>
62+</td>
63+</tr>
59<tr id="row849110591151"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p148180593320"><a name="p148180593320"></a><a name="p148180593320"></a><a href="sql_statistics.md">SQL Statistics</a></p>64<tr id="row849110591151"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p148180593320"><a name="p148180593320"></a><a name="p148180593320"></a><a href="sql_statistics.md">SQL Statistics</a></p>
60</td>65</td>
61<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul275315279205"></a><a name="ul275315279205"></a><ul id="ul275315279205"><li>SQL语句各个维度性能统计:端到端时间,行活动,缓存命中,CPU消耗,时间消耗细分。</li><li>数据库、节点范围报表,cluster模式和node模式下均可查看此报表。</li></ul>66<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul275315279205"></a><a name="ul275315279205"></a><ul id="ul275315279205"><li>SQL语句各个维度性能统计:端到端时间,行活动,缓存命中,CPU消耗,时间消耗细分。</li><li>数据库、节点范围报表,cluster模式和node模式下均可查看此报表。</li></ul>
@@ -78,7 +83,7 @@ openGauss数据库WDR报表主要内容如下表所示。
78</tr>83</tr>
79<tr id="row156411451131512"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p12651331239"><a name="p12651331239"></a><a name="p12651331239"></a><a href="object_stats.md">Object stats</a></p>84<tr id="row156411451131512"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p12651331239"><a name="p12651331239"></a><a name="p12651331239"></a><a href="object_stats.md">Object stats</a></p>
80</td>85</td>
81-<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul8257222112020"></a><a name="ul8257222112020"></a><ul id="ul8257222112020"><li>表、索引维度的性能统计信息。</li><li>数据库、节点范围报表,cluster模式和node模式下均可查看此报表。</li></ul>86+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul8257222112020"></a><a name="ul8257222112020"></a><ul id="ul8257222112020"><li>表、索引维度的性能统计信息,以及区间内未使用的用户索引。</li><li>数据库、节点范围报表,cluster模式和node模式下均可查看此报表。</li></ul>
82</td>87</td>
83</tr>88</tr>
84<tr id="row8845174912158"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p14537204613311"><a name="p14537204613311"></a><a name="p14537204613311"></a><a href="configuration_settings.md">Configuration settings</a></p>89<tr id="row8845174912158"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p14537204613311"><a name="p14537204613311"></a><a name="p14537204613311"></a><a href="configuration_settings.md">Configuration settings</a></p>
@@ -75,7 +75,7 @@ The WDR depends on the following two components:
75</tr>75</tr>
76<tr id="row123476454170"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p934714512178"><a name="p934714512178"></a><a name="p934714512178"></a>Memory Statistics</p>76<tr id="row123476454170"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p934714512178"><a name="p934714512178"></a><a name="p934714512178"></a>Memory Statistics</p>
77</td>77</td>
78-<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p434712455175"><a name="p434712455175"></a><a name="p434712455175"></a>Includes maximum process memory, used process memory, maximum shared memory, and used shared memory.</p>78+<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p434712455175"><a name="p434712455175"></a><a name="p434712455175"></a>Includes maximum process memory, used process memory, maximum shared memory, used shared memory, and key shared-memory component sizes and percentages.</p>
79</td>79</td>
80</tr>80</tr>
81</tbody>81</tbody>
@@ -96,10 +96,16 @@ The WDR depends on the following two components:
96<p id="p33332484313"><a name="p33332484313"></a><a name="p33332484313"></a>The statistics include time consumed by the system in each phase, including the kernel time, CPU time, execution time, parsing time, compilation time, query rewriting time, plan generation time, network time, and I/O time.</p>96<p id="p33332484313"><a name="p33332484313"></a><a name="p33332484313"></a>The statistics include time consumed by the system in each phase, including the kernel time, CPU time, execution time, parsing time, compilation time, query rewriting time, plan generation time, network time, and I/O time.</p>
97</td>97</td>
98</tr>98</tr>
99+<tr id="row-protocol-statistics"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p>Protocol Statistics</p>
100+</td>
101+<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p>Diagnoses protocol-message execution count and elapsed time.</p>
102+<p>Includes Simple Query, Parse, Bind, Execute, Describe, Sync, Close, and Batch Bind-Execute with Exec Count, Total Time(s), Avg Time(ms), and % of DB Time.</p>
103+</td>
104+</tr>
99<tr id="row1233374883113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p10333948163119"><a name="p10333948163119"></a><a name="p10333948163119"></a>SQL Statistics</p>105<tr id="row1233374883113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p10333948163119"><a name="p10333948163119"></a><a name="p10333948163119"></a>SQL Statistics</p>
100</td>106</td>
101<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p367217315715"><a name="p367217315715"></a><a name="p367217315715"></a>Diagnoses SQL statement performance problems.</p>107<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p367217315715"><a name="p367217315715"></a><a name="p367217315715"></a>Diagnoses SQL statement performance problems.</p>
102-<p id="p103331848113117"><a name="p103331848113117"></a><a name="p103331848113117"></a>The statistics include normalized SQL performance indicators in multiple dimensions: elapsed time, CPU time, rows returned, tuple reads, executions, physical reads, and logical reads. The indicators can be classified into execution time, number of execution times, row activity, and cache I/O.</p>108+<p id="p103331848113117"><a name="p103331848113117"></a><a name="p103331848113117"></a>The statistics include normalized SQL performance indicators in multiple dimensions: elapsed time, CPU time, rows returned, tuple reads, executions, physical reads, and logical reads. The indicators can be classified into execution time, number of execution times, row activity, and cache I/O. Per-database execution count and elapsed time are also included.</p>
103</td>109</td>
104</tr>110</tr>
105<tr id="row1933324873111"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p183331348193119"><a name="p183331348193119"></a><a name="p183331348193119"></a>Wait Events</p>111<tr id="row1933324873111"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p183331348193119"><a name="p183331348193119"></a><a name="p183331348193119"></a>Wait Events</p>
@@ -123,7 +129,7 @@ The WDR depends on the following two components:
123<tr id="row123341448113113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p11334848143110"><a name="p11334848143110"></a><a name="p11334848143110"></a>Object stats</p>129<tr id="row123341448113113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p11334848143110"><a name="p11334848143110"></a><a name="p11334848143110"></a>Object stats</p>
124</td>130</td>
125<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p14405135119915"><a name="p14405135119915"></a><a name="p14405135119915"></a>Diagnoses the performance of database objects.</p>131<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p14405135119915"><a name="p14405135119915"></a><a name="p14405135119915"></a>Diagnoses the performance of database objects.</p>
126-<p id="p6334174863119"><a name="p6334174863119"></a><a name="p6334174863119"></a>The statistics include user tables, tables on indexes, index scan activities, as well as insert, update, and delete activities, number of valid rows, and table maintenance status.</p>132+<p id="p6334174863119"><a name="p6334174863119"></a><a name="p6334174863119"></a>The statistics include user tables, tables on indexes, index scan activities, as well as insert, update, and delete activities, number of valid rows, table maintenance status, and unused user indexes in the snapshot interval.</p>
127</td>133</td>
128</tr>134</tr>
129<tr id="row1427793219359"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p32775326355"><a name="p32775326355"></a><a name="p32775326355"></a>Configuration settings</p>135<tr id="row1427793219359"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p32775326355"><a name="p32775326355"></a><a name="p32775326355"></a>Configuration settings</p>
@@ -142,7 +148,10 @@ The WDR depends on the following two components:
142 148 
143## Enhancements<a name="section9602018103411"></a>149## Enhancements<a name="section9602018103411"></a>
144 150 
145-None.151+- Shared Memory Statistics: Top 10 shared-memory candidate components by size plus (Total). Node-wide report, which can be viewed in node mode for summary or all report types.
152+- Protocol Statistics (Protocol Message Statistics): Exec Count, Total Time(s), Avg Time(ms), and % of DB Time for eight protocol message types. Node-wide report, which can be viewed in node mode for detail or all report types.
153+- SQL Stats by Database: per-database SQL execution count and elapsed time. Node-wide report, which can be viewed in node mode for detail or all report types.
154+- Unused Indexes: unused user indexes in the snapshot interval under Object stats. Database/Node-wide report, which can be viewed in cluster or node mode for detail or all report types.
146 155 
147## Constraints<a name="section1956417145819"></a>156## Constraints<a name="section1956417145819"></a>
148 157 
@@ -45,5 +45,12 @@
45<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"><a name="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"></a><a name="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"></a>Time value, in μs</p>45<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"><a name="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"></a><a name="en-us_topic_0283137436_en-us_topic_0237122542_p125797399330"></a>Time value, in μs</p>
46</td>46</td>
47</tr>47</tr>
48+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
49+</td>
50+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
51+</td>
52+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>Cumulative call count for the corresponding time type (used by protocol-message statistics deltas).</p>
53+</td>
54+</tr>
48</tbody>55</tbody>
49</table>56</table>
@@ -173,6 +173,10 @@ sections:
173 href: ./instance_time.md173 href: ./instance_time.md
174 - label: GLOBAL_INSTANCE_TIME174 - label: GLOBAL_INSTANCE_TIME
175 href: ./global_instance_time.md175 href: ./global_instance_time.md
176+ - label: DATABASE_SQL_STAT
177+ href: ./database_sql_stat.md
178+ - label: SUMMARY_DATABASE_SQL_STAT
179+ href: ./summary_database_sql_stat.md
176 - label: Memory180 - label: Memory
177 sections:181 sections:
178 - label: MEMORY_NODE_DETAIL182 - label: MEMORY_NODE_DETAIL
@@ -0,0 +1,18 @@
1+# DATABASE\_SQL\_STAT
2+ 
3+Records per-database SQL execution statistics on the current node. Counters are accumulated on the Unique SQL completion path. Unique SQL must be enabled; otherwise the counters do not increase.
4+ 
5+**Table 1** DATABASE\_SQL\_STAT columns
6+ 
7+<table><thead align="left"><tr>
8+<th class="cellrowborder" valign="top" width="17.27%"><p><strong>Name</strong></p></th>
9+<th class="cellrowborder" valign="top" width="16.8%"><p><strong>Type</strong></p></th>
10+<th class="cellrowborder" valign="top" width="65.93%"><p><strong>Description</strong></p></th>
11+</tr></thead>
12+<tbody>
13+<tr><td class="cellrowborder" valign="top"><p>node_name</p></td><td class="cellrowborder" valign="top"><p>text</p></td><td class="cellrowborder" valign="top"><p>Node name.</p></td></tr>
14+<tr><td class="cellrowborder" valign="top"><p>datid</p></td><td class="cellrowborder" valign="top"><p>oid</p></td><td class="cellrowborder" valign="top"><p>Database OID.</p></td></tr>
15+<tr><td class="cellrowborder" valign="top"><p>datname</p></td><td class="cellrowborder" valign="top"><p>name</p></td><td class="cellrowborder" valign="top"><p>Database name.</p></td></tr>
16+<tr><td class="cellrowborder" valign="top"><p>n_calls</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>Cumulative SQL execution count for the database.</p></td></tr>
17+<tr><td class="cellrowborder" valign="top"><p>total_elapse_time</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>Cumulative SQL elapsed time for the database (microseconds).</p></td></tr>
18+</tbody></table>
Binary files do not support preview
@@ -41,5 +41,12 @@
41<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0237122558_p1180114397349"><a name="en-us_topic_0237122558_p1180114397349"></a><a name="en-us_topic_0237122558_p1180114397349"></a>Duration (unit: μs)</p>41<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0237122558_p1180114397349"><a name="en-us_topic_0237122558_p1180114397349"></a><a name="en-us_topic_0237122558_p1180114397349"></a>Duration (unit: μs)</p>
42</td>42</td>
43</tr>43</tr>
44+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
45+</td>
46+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
47+</td>
48+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>Cumulative call count for the corresponding time type (used by protocol-message statistics deltas).</p>
49+</td>
50+</tr>
44</tbody>51</tbody>
45</table>52</table>
@@ -45,5 +45,12 @@
45<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0237122557_p125797399330"><a name="en-us_topic_0237122557_p125797399330"></a><a name="en-us_topic_0237122557_p125797399330"></a>Time value (unit: μs)</p>45<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="en-us_topic_0237122557_p125797399330"><a name="en-us_topic_0237122557_p125797399330"></a><a name="en-us_topic_0237122557_p125797399330"></a>Time value (unit: μs)</p>
46</td>46</td>
47</tr>47</tr>
48+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
49+</td>
50+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
51+</td>
52+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>Cumulative call count for the corresponding time type (used by protocol-message statistics deltas).</p>
53+</td>
54+</tr>
48</tbody>55</tbody>
49</table>56</table>
@@ -33,3 +33,21 @@ The following table lists metrics in the Memory Statistics report.
33</tr>33</tr>
34</tbody>34</tbody>
35</table>35</table>
36+ 
37+## Shared Memory Statistics
38+ 
39+Shows the Top 10 shared-memory candidate components by size at the end snapshot, plus a (Total) row. The percentage denominator is max_shared_memory. Node-wide report, which can be viewed in node mode for summary or all report types.
40+ 
41+Candidates: Buffer Blocks, Buffer Descriptors, Buffer Descriptors Extra, Checkpoint BufferIds, clog, XLOG Ctl, CSNLOG Ctl, PgStat, AshContext, IncreCheckPointContext, Undo, imcstore context, and DoubleWriteContext.
42+ 
43+Data sources: snapshot.snap_global_shared_memory_detail and snapshot.snap_global_memory_node_detail.
44+ 
45+**Table 2 Columns in Shared Memory Statistics**
46+ 
47+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>Column</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>Description</strong></p></th></tr></thead>
48+<tbody>
49+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Shared Memory</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Shared-memory component name. Includes (Total) and the Top 10 candidates by size.</p></td></tr>
50+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Size</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Component size (MB or GB). The (Total) row is max_shared_memory.</p></td></tr>
51+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Pct(%)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Percentage relative to max_shared_memory; (Total) is 100%.</p></td></tr>
52+</tbody>
53+</table>
@@ -1,6 +1,6 @@
1# Object stats<a name="EN-US_TOPIC_0000001260195075"></a>1# Object stats<a name="EN-US_TOPIC_0000001260195075"></a>
2 2 
3-Object stats contains three tables: User Tables stats, User index stats, and Bad lock stats. Columns in the tables are described as follows:3+Object stats contains four tables: User Tables stats, User index stats, Bad lock stats, and Unused Indexes. Columns in the tables are described as follows:
4 4 
5## User Tables stats<a name="section155172118496"></a>5## User Tables stats<a name="section155172118496"></a>
6 6 
@@ -218,3 +218,19 @@ Object stats contains three tables: User Tables stats, User index stats, and Bad
218</tr>218</tr>
219</tbody>219</tbody>
220</table>220</table>
221+ 
222+## Unused Indexes
223+ 
224+Lists user indexes whose idx_scan delta between the begin and end snapshots is 0 (system schemas excluded, same rule as User index stats). Database/Node-wide report, which can be viewed in cluster or node mode for detail or all report types, up to 200 rows.
225+ 
226+**Table 4 Columns in Unused Indexes**
227+ 
228+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>Column</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>Description</strong></p></th></tr></thead>
229+<tbody>
230+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>DB Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Database name.</p></td></tr>
231+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Schema</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Schema name.</p></td></tr>
232+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Table Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Table name.</p></td></tr>
233+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Index Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Index name.</p></td></tr>
234+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Total Index Scans</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Cumulative index scan count at the end snapshot (not a delta).</p></td></tr>
235+</tbody>
236+</table>
@@ -143,3 +143,23 @@ The following table describes columns in the SQL Statistics report.
143</tr>143</tr>
144</tbody>144</tbody>
145</table>145</table>
146+ 
147+## SQL Stats by Database
148+ 
149+Aggregates Unique SQL completion-path execution count and elapsed time by database, and computes the percentage of instance DB_TIME. Node-wide report, which can be viewed in node mode for detail or all report types. Unique SQL must be enabled.
150+ 
151+Data source: snapshot.snap_summary_database_sql_stat (from dbe_perf.summary_database_sql_stat / dbe_perf.database_sql_stat).
152+ 
153+**Table 2 Columns in SQL Stats by Database**
154+ 
155+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>Column</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>Description</strong></p></th></tr></thead>
156+<tbody>
157+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>DB Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Database name.</p></td></tr>
158+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Exec Count</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Execution-count delta for the database between snapshots.</p></td></tr>
159+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Total Time(s)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Total elapsed time in seconds.</p></td></tr>
160+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Avg Time(ms)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Average elapsed time in milliseconds; 0 when Exec Count is 0.</p></td></tr>
161+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>% of DB Time</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Percentage of the instance DB_TIME delta.</p></td></tr>
162+</tbody>
163+</table>
164+ 
165+Only databases with Exec Count or elapsed-time delta greater than 0 are listed, ordered by Total Time descending.
@@ -0,0 +1,18 @@
1+# SUMMARY\_DATABASE\_SQL\_STAT
2+ 
3+Provides per-database SQL execution statistics from all healthy nodes in openGauss (see [DATABASE\_SQL\_STAT](database_sql_stat.md) for column meanings). Aggregated by `dbe_perf.get_summary_database_sql_stat()` from each node's `database_sql_stat`, and used as the source of the WDR snapshot table `snap_summary_database_sql_stat`.
4+ 
5+**Table 1** SUMMARY\_DATABASE\_SQL\_STAT columns
6+ 
7+<table><thead align="left"><tr>
8+<th class="cellrowborder" valign="top" width="17.27%"><p><strong>Name</strong></p></th>
9+<th class="cellrowborder" valign="top" width="16.8%"><p><strong>Type</strong></p></th>
10+<th class="cellrowborder" valign="top" width="65.93%"><p><strong>Description</strong></p></th>
11+</tr></thead>
12+<tbody>
13+<tr><td class="cellrowborder" valign="top"><p>node_name</p></td><td class="cellrowborder" valign="top"><p>text</p></td><td class="cellrowborder" valign="top"><p>Node name.</p></td></tr>
14+<tr><td class="cellrowborder" valign="top"><p>datid</p></td><td class="cellrowborder" valign="top"><p>oid</p></td><td class="cellrowborder" valign="top"><p>Database OID.</p></td></tr>
15+<tr><td class="cellrowborder" valign="top"><p>datname</p></td><td class="cellrowborder" valign="top"><p>name</p></td><td class="cellrowborder" valign="top"><p>Database name.</p></td></tr>
16+<tr><td class="cellrowborder" valign="top"><p>n_calls</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>Cumulative SQL execution count for the database.</p></td></tr>
17+<tr><td class="cellrowborder" valign="top"><p>total_elapse_time</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>Cumulative SQL elapsed time for the database (microseconds).</p></td></tr>
18+</tbody></table>
@@ -63,3 +63,44 @@ The following table describes metrics in the Time Model report.
63</tr>63</tr>
64</tbody>64</tbody>
65</table>65</table>
66+ 
67+## Protocol Message Statistics
68+ 
69+In the WDR report, the module title is **Protocol Statistics** and the table title is **Protocol Message Statistics**.
70+ 
71+Aggregates execution count and elapsed time by protocol message type between snapshots, and computes the percentage of instance DB_TIME. Data comes from `snapshot.snap_global_instance_time` (`snap_value` / `snap_n_calls`), the same source as Time Model. Node-wide report, which can be viewed in node mode for detail or all report types.
72+ 
73+**Table 2 Protocol message type mapping**
74+ 
75+<table><thead align="left"><tr>
76+<th class="cellrowborder" valign="top" width="8%" id="h0"><p><strong>No.</strong></p></th>
77+<th class="cellrowborder" valign="top" width="22%" id="h1"><p><strong>Report name (Message Type)</strong></p></th>
78+<th class="cellrowborder" valign="top" width="28%" id="h2"><p><strong>Internal stat_name</strong></p></th>
79+<th class="cellrowborder" valign="top" width="42%" id="h3"><p><strong>Meaning</strong></p></th>
80+</tr></thead>
81+<tbody>
82+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>1</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Simple Query</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT2_SIMPLE_QUERY</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Simple-query protocol path (Q message): elapsed time and execution count</p></td></tr>
83+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>2</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Parse</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT6_P</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Parse phase</p></td></tr>
84+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>3</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Bind</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT7_B</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Bind phase</p></td></tr>
85+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>4</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Execute</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT8_E</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Execute phase</p></td></tr>
86+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>5</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Describe</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT9_D</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Describe phase</p></td></tr>
87+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>6</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Sync</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT10_S</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Sync phase</p></td></tr>
88+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>7</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Close</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT11_C</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Extended-query Close phase</p></td></tr>
89+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>8</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Batch Bind-Execute</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>Exact match SRT12_U</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>Batch Bind-Execute path (U message): elapsed time and execution count</p></td></tr>
90+</tbody>
91+</table>
92+ 
93+ 
94+**Table 3 Columns in Protocol Message Statistics**
95+ 
96+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>Column</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>Description</strong></p></th></tr></thead>
97+<tbody>
98+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Message Type</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Protocol message type (see the mapping above).</p></td></tr>
99+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Exec Count</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Execution-count delta between snapshots (end − begin n_calls).</p></td></tr>
100+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Total Time(s)</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Total elapsed time in seconds (converted from microsecond delta).</p></td></tr>
101+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Avg Time(ms)</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Average elapsed time in milliseconds; 0 when Exec Count is 0.</p></td></tr>
102+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>% of DB Time</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Percentage of the instance DB_TIME delta.</p></td></tr>
103+</tbody>
104+</table>
105+ 
106+Rows are ordered by Total Time descending. Exec Count and elapsed time may be 0 when there is no activity for that message type.
@@ -3,3 +3,8 @@
3The naming rule of a WDR snapshot data table is **snap\_**_\{Source data table\}_.3The naming rule of a WDR snapshot data table is **snap\_**_\{Source data table\}_.
4 4 
5WDR snapshot data tables come from all views in [DBE\_PERF Schema](dbe_perf_schema.md).5WDR snapshot data tables come from all views in [DBE\_PERF Schema](dbe_perf_schema.md).
6+ 
7+Related additions/extensions for this feature:
8+ 
9+- `snap_global_instance_time` adds `snap_n_calls`, corresponding to `n_calls` of `pv_instance_time` / `dbe_perf.instance_time`, used by Protocol Message Statistics deltas.
10+- New table `snap_summary_database_sql_stat` is sourced from `dbe_perf.summary_database_sql_stat` and used by SQL Stats by Database.
@@ -48,7 +48,7 @@ The following table describes the WDR content of the openGauss database.
48</tr>48</tr>
49<tr id="row1212013312166"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p7991716336"><a name="p7991716336"></a><a name="p7991716336"></a><a href="memory_statistics.md">Memory Statistics</a></p>49<tr id="row1212013312166"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p7991716336"><a name="p7991716336"></a><a name="p7991716336"></a><a href="memory_statistics.md">Memory Statistics</a></p>
50</td>50</td>
51-<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul4459131414205"></a><a name="ul4459131414205"></a><ul id="ul4459131414205"><li>Kernel memory usage.</li><li>Node-wide report, which can be viewed in node mode.</li></ul>51+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul4459131414205"></a><a name="ul4459131414205"></a><ul id="ul4459131414205"><li>Kernel memory usage and key shared-memory component sizes and percentages.</li><li>Node-wide report, which can be viewed in node mode.</li></ul>
52</td>52</td>
53</tr>53</tr>
54<tr id="row1213317120167"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p1316142615558"><a name="p1316142615558"></a><a name="p1316142615558"></a><a href="time_model.md">Time Model</a></p>54<tr id="row1213317120167"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p1316142615558"><a name="p1316142615558"></a><a name="p1316142615558"></a><a href="time_model.md">Time Model</a></p>
@@ -56,6 +56,11 @@ The following table describes the WDR content of the openGauss database.
56<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul16141716192014"></a><a name="ul16141716192014"></a><ul id="ul16141716192014"><li>Time distribution information about the statements in a node.</li><li>Node-wide report, which can be viewed in node mode.</li></ul>56<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul16141716192014"></a><a name="ul16141716192014"></a><ul id="ul16141716192014"><li>Time distribution information about the statements in a node.</li><li>Node-wide report, which can be viewed in node mode.</li></ul>
57</td>57</td>
58</tr>58</tr>
59+<tr id="row-protocol-message-stat"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p><a href="time_model.md#protocol-message-statistics">Protocol Statistics</a></p>
60+</td>
61+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><ul><li>Execution count, elapsed time, and % of DB Time by protocol message type (Simple Query / Parse / Bind / Execute / Describe / Sync / Close / Batch Bind-Execute).</li><li>Node-wide report, which can be viewed in node mode for detail or all report types.</li></ul>
62+</td>
63+</tr>
59<tr id="row849110591151"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p148180593320"><a name="p148180593320"></a><a name="p148180593320"></a><a href="sql_statistics.md">SQL Statistics</a></p>64<tr id="row849110591151"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p148180593320"><a name="p148180593320"></a><a name="p148180593320"></a><a href="sql_statistics.md">SQL Statistics</a></p>
60</td>65</td>
61<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul275315279205"></a><a name="ul275315279205"></a><ul id="ul275315279205"><li>SQL statement performance statistics: end-to-end time, row activities, cache hit, CPU consumption, and time consumption.</li><li>Database/Node-wide report, which can be viewed in cluster or node mode.</li></ul>66<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul275315279205"></a><a name="ul275315279205"></a><ul id="ul275315279205"><li>SQL statement performance statistics: end-to-end time, row activities, cache hit, CPU consumption, and time consumption.</li><li>Database/Node-wide report, which can be viewed in cluster or node mode.</li></ul>
@@ -78,7 +83,7 @@ The following table describes the WDR content of the openGauss database.
78</tr>83</tr>
79<tr id="row156411451131512"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p12651331239"><a name="p12651331239"></a><a name="p12651331239"></a><a href="object_stats.md">Object stats</a></p>84<tr id="row156411451131512"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p12651331239"><a name="p12651331239"></a><a name="p12651331239"></a><a href="object_stats.md">Object stats</a></p>
80</td>85</td>
81-<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul8257222112020"></a><a name="ul8257222112020"></a><ul id="ul8257222112020"><li>Performance statistics on the index and table dimensions.</li><li>Database/Node-wide report, which can be viewed in cluster or node mode.</li></ul>86+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul8257222112020"></a><a name="ul8257222112020"></a><ul id="ul8257222112020"><li>Performance statistics on the index and table dimensions, and unused user indexes in the snapshot interval.</li><li>Database/Node-wide report, which can be viewed in cluster or node mode.</li></ul>
82</td>87</td>
83</tr>88</tr>
84<tr id="row8845174912158"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p14537204613311"><a name="p14537204613311"></a><a name="p14537204613311"></a><a href="configuration_settings_60.md">Configuration settings</a></p>89<tr id="row8845174912158"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p14537204613311"><a name="p14537204613311"></a><a name="p14537204613311"></a><a href="configuration_settings_60.md">Configuration settings</a></p>
@@ -75,7 +75,7 @@ WDR主要依赖两个组件:
75</tr>75</tr>
76<tr id="row123476454170"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p934714512178"><a name="p934714512178"></a><a name="p934714512178"></a>Memory Statistics</p>76<tr id="row123476454170"><td class="cellrowborder" valign="top" width="24.759999999999998%" headers="mcps1.2.3.1.1 "><p id="p934714512178"><a name="p934714512178"></a><a name="p934714512178"></a>Memory Statistics</p>
77</td>77</td>
78-<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p434712455175"><a name="p434712455175"></a><a name="p434712455175"></a>包含最大进程内存、进程已经使用内存、最大共享内存、已经使用共享内存大小等。</p>78+<td class="cellrowborder" valign="top" width="75.24%" headers="mcps1.2.3.1.2 "><p id="p434712455175"><a name="p434712455175"></a><a name="p434712455175"></a>包含最大进程内存、进程已经使用内存、最大共享内存、已经使用共享内存大小,以及关键共享内存组件占用与占比等。</p>
79</td>79</td>
80</tr>80</tr>
81</tbody>81</tbody>
@@ -96,10 +96,16 @@ WDR主要依赖两个组件:
96<p id="p33332484313"><a name="p33332484313"></a><a name="p33332484313"></a>包含系统在各个阶段上消耗的时间:内核时间、CPU时间、执行时间、解析时间、编译时间、查询重写时间、计划生成时间、网络时间、IO时间。</p>96<p id="p33332484313"><a name="p33332484313"></a><a name="p33332484313"></a>包含系统在各个阶段上消耗的时间:内核时间、CPU时间、执行时间、解析时间、编译时间、查询重写时间、计划生成时间、网络时间、IO时间。</p>
97</td>97</td>
98</tr>98</tr>
99+<tr id="row-protocol-statistics"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p>Protocol Statistics</p>
100+</td>
101+<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p>按协议报文类型统计执行次数与耗时。</p>
102+<p>包含 Simple Query、Parse、Bind、Execute、Describe、Sync、Close、Batch Bind-Execute 的 Exec Count、Total Time(s)、Avg Time(ms)、% of DB Time。</p>
103+</td>
104+</tr>
99<tr id="row1233374883113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p10333948163119"><a name="p10333948163119"></a><a name="p10333948163119"></a>SQL Statistics</p>105<tr id="row1233374883113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p10333948163119"><a name="p10333948163119"></a><a name="p10333948163119"></a>SQL Statistics</p>
100</td>106</td>
101<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p367217315715"><a name="p367217315715"></a><a name="p367217315715"></a>主要用于SQL语句性能问题的诊断。</p>107<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p367217315715"><a name="p367217315715"></a><a name="p367217315715"></a>主要用于SQL语句性能问题的诊断。</p>
102-<p id="p103331848113117"><a name="p103331848113117"></a><a name="p103331848113117"></a>包含归一化的SQL的性能指标在多个维度上的排序:Elapsed Time、CPU Time、Rows Returned、Tuples Reads、Executions、Physical Reads、Logical Reads。这些指标的种类包括:执行时间,执行次数、行活动、Cache IO等。</p>108+<p id="p103331848113117"><a name="p103331848113117"></a><a name="p103331848113117"></a>包含归一化的SQL的性能指标在多个维度上的排序:Elapsed Time、CPU Time、Rows Returned、Tuples Reads、Executions、Physical Reads、Logical Reads。这些指标的种类包括:执行时间,执行次数、行活动、Cache IO等。另包含按数据库聚合的执行次数与耗时。</p>
103</td>109</td>
104</tr>110</tr>
105<tr id="row1933324873111"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p183331348193119"><a name="p183331348193119"></a><a name="p183331348193119"></a>Wait Events</p>111<tr id="row1933324873111"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p183331348193119"><a name="p183331348193119"></a><a name="p183331348193119"></a>Wait Events</p>
@@ -123,7 +129,7 @@ WDR主要依赖两个组件:
123<tr id="row123341448113113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p11334848143110"><a name="p11334848143110"></a><a name="p11334848143110"></a>Object stats</p>129<tr id="row123341448113113"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p11334848143110"><a name="p11334848143110"></a><a name="p11334848143110"></a>Object stats</p>
124</td>130</td>
125<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p14405135119915"><a name="p14405135119915"></a><a name="p14405135119915"></a>用于诊断数据库对象的性能。</p>131<td class="cellrowborder" valign="top" width="75.07000000000001%" headers="mcps1.2.3.1.2 "><p id="p14405135119915"><a name="p14405135119915"></a><a name="p14405135119915"></a>用于诊断数据库对象的性能。</p>
126-<p id="p6334174863119"><a name="p6334174863119"></a><a name="p6334174863119"></a>包含用户表、索引上的表、索引扫描活动,insert、update、delete活动,有效行数量,表维护操作的状态等。</p>132+<p id="p6334174863119"><a name="p6334174863119"></a><a name="p6334174863119"></a>包含用户表、索引上的表、索引扫描活动,insert、update、delete活动,有效行数量,表维护操作的状态,以及区间内未使用的用户索引等。</p>
127</td>133</td>
128</tr>134</tr>
129<tr id="row1427793219359"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p32775326355"><a name="p32775326355"></a><a name="p32775326355"></a>Configuration settings</p>135<tr id="row1427793219359"><td class="cellrowborder" valign="top" width="24.93%" headers="mcps1.2.3.1.1 "><p id="p32775326355"><a name="p32775326355"></a><a name="p32775326355"></a>Configuration settings</p>
@@ -142,7 +148,10 @@ WDR主要依赖两个组件:
142 148 
143## 特性增强<a name="section9602018103411"></a>149## 特性增强<a name="section9602018103411"></a>
144 150 
145-无。151+- Shared Memory Statistics:展示共享内存候选组件中按大小排序的Top 10及(Total)。节点范围报表,仅node模式下的summary或all报告可查看。
152+- Protocol Statistics(Protocol Message Statistics):按 8 种协议报文类型统计 Exec Count、Total Time(s)、Avg Time(ms)、% of DB Time。节点范围报表,仅 node 模式下的 detail 或 all 报告可查看。
153+- SQL Stats by Database:按数据库聚合SQL执行次数与耗时。节点范围报表,仅node模式下的detail或all报告可查看。
154+- Unused Indexes:输出区间内未使用的用户索引。数据库、节点范围报表,cluster模式和node模式下的detail或all报告可查看。
146 155 
147## 特性约束<a name="section1956417145819"></a>156## 特性约束<a name="section1956417145819"></a>
148 157 
@@ -60,5 +60,12 @@
60<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"><a name="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"></a><a name="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"></a>时间值(单位:微秒)。</p>60<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"><a name="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"></a><a name="zh-cn_topic_0283137436_zh-cn_topic_0237122542_p125797399330"></a>时间值(单位:微秒)。</p>
61</td>61</td>
62</tr>62</tr>
63+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
64+</td>
65+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
66+</td>
67+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>对应时间类型的累计调用次数(协议报文类统计等依赖此字段差分)。</p>
68+</td>
69+</tr>
63</tbody>70</tbody>
64</table>71</table>
@@ -207,6 +207,10 @@ sections:
207 href: ./instance_time.md207 href: ./instance_time.md
208 - label: GLOBAL_INSTANCE_TIME208 - label: GLOBAL_INSTANCE_TIME
209 href: ./global_instance_time.md209 href: ./global_instance_time.md
210+ - label: DATABASE_SQL_STAT
211+ href: ./database_sql_stat.md
212+ - label: SUMMARY_DATABASE_SQL_STAT
213+ href: ./summary_database_sql_stat.md
210 - label: Memory214 - label: Memory
211 sections:215 sections:
212 - label: MEMORY_NODE_DETAIL216 - label: MEMORY_NODE_DETAIL
@@ -0,0 +1,18 @@
1+# DATABASE\_SQL\_STAT
2+ 
3+提供当前节点按数据库聚合的SQL执行统计(在Unique SQL完成路径上累计)。需开启Unique SQL相关能力,否则计数不增长。
4+ 
5+**表 1** DATABASE\_SQL\_STAT字段
6+ 
7+<table><thead align="left"><tr>
8+<th class="cellrowborder" valign="top" width="17.27%"><p><strong>名称</strong></p></th>
9+<th class="cellrowborder" valign="top" width="16.8%"><p><strong>类型</strong></p></th>
10+<th class="cellrowborder" valign="top" width="65.93%"><p><strong>描述</strong></p></th>
11+</tr></thead>
12+<tbody>
13+<tr><td class="cellrowborder" valign="top"><p>node_name</p></td><td class="cellrowborder" valign="top"><p>text</p></td><td class="cellrowborder" valign="top"><p>节点名称。</p></td></tr>
14+<tr><td class="cellrowborder" valign="top"><p>datid</p></td><td class="cellrowborder" valign="top"><p>oid</p></td><td class="cellrowborder" valign="top"><p>数据库OID。</p></td></tr>
15+<tr><td class="cellrowborder" valign="top"><p>datname</p></td><td class="cellrowborder" valign="top"><p>name</p></td><td class="cellrowborder" valign="top"><p>数据库名称。</p></td></tr>
16+<tr><td class="cellrowborder" valign="top"><p>n_calls</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>该库累计SQL执行次数。</p></td></tr>
17+<tr><td class="cellrowborder" valign="top"><p>total_elapse_time</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>该库累计SQL总耗时(微秒)。</p></td></tr>
18+</tbody></table>
Binary files do not support preview
@@ -41,5 +41,12 @@
41<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0237122558_p1180114397349"><a name="zh-cn_topic_0237122558_p1180114397349"></a><a name="zh-cn_topic_0237122558_p1180114397349"></a>时间值(单位:微秒)。</p>41<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0237122558_p1180114397349"><a name="zh-cn_topic_0237122558_p1180114397349"></a><a name="zh-cn_topic_0237122558_p1180114397349"></a>时间值(单位:微秒)。</p>
42</td>42</td>
43</tr>43</tr>
44+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
45+</td>
46+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
47+</td>
48+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>对应时间类型的累计调用次数(协议报文类统计等依赖此字段差分)。</p>
49+</td>
50+</tr>
44</tbody>51</tbody>
45</table>52</table>
@@ -60,5 +60,12 @@
60<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0237122557_p125797399330"><a name="zh-cn_topic_0237122557_p125797399330"></a><a name="zh-cn_topic_0237122557_p125797399330"></a>时间值(单位:微秒)。</p>60<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0237122557_p125797399330"><a name="zh-cn_topic_0237122557_p125797399330"></a><a name="zh-cn_topic_0237122557_p125797399330"></a>时间值(单位:微秒)。</p>
61</td>61</td>
62</tr>62</tr>
63+<tr id="row-n-calls"><td class="cellrowborder" valign="top" width="17.27%" headers="mcps1.2.4.1.1 "><p>n_calls</p>
64+</td>
65+<td class="cellrowborder" valign="top" width="16.8%" headers="mcps1.2.4.1.2 "><p>bigint</p>
66+</td>
67+<td class="cellrowborder" valign="top" width="65.93%" headers="mcps1.2.4.1.3 "><p>对应时间类型的累计调用次数(协议报文类统计等依赖此字段差分)。</p>
68+</td>
69+</tr>
63</tbody>70</tbody>
64</table>71</table>
@@ -33,3 +33,21 @@ Memory Statistics指标名称及描述如下表所示。
33</tr>33</tr>
34</tbody>34</tbody>
35</table>35</table>
36+ 
37+## Shared Memory Statistics
38+ 
39+展示结束快照时刻共享内存候选组件中按占用大小排序的Top 10及(Total)行。占比分母为max_shared_memory。节点范围报表,仅node模式下的summary或all报告可查看。
40+ 
41+候选组件包括:Buffer Blocks、Buffer Descriptors、Buffer Descriptors Extra、Checkpoint BufferIds、clog、XLOG Ctl、CSNLOG Ctl、PgStat、AshContext、IncreCheckPointContext、Undo、imcstore context、DoubleWriteContext。
42+ 
43+数据来源:snapshot.snap_global_shared_memory_detail、snapshot.snap_global_memory_node_detail。
44+ 
45+**表 2 Shared Memory Statistics报表主要内容**
46+ 
47+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>列名称</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>描述</strong></p></th></tr></thead>
48+<tbody>
49+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Shared Memory</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>共享内存组件名称。含(Total)以及候选组件中按大小排序的Top 10。</p></td></tr>
50+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Size</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>组件占用大小(MB或GB)。(Total)行为max_shared_memory。</p></td></tr>
51+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Pct(%)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>相对max_shared_memory的占比;(Total)为100%。</p></td></tr>
52+</tbody>
53+</table>
@@ -1,6 +1,6 @@
1# Object stats1# Object stats
2 2 
3-Object stats包含User Tables stats、User index stats和Bad lock stats三张表,列名称及描述如下所示。3+Object stats包含User Tables stats、User index stats、Bad lock stats和Unused Indexes四张表,列名称及描述如下所示。
4 4 
5## User Tables stats<a name="section155172118496"></a>5## User Tables stats<a name="section155172118496"></a>
6 6 
@@ -218,3 +218,19 @@ Object stats包含User Tables stats、User index stats和Bad lock stats三张表
218</tr>218</tr>
219</tbody>219</tbody>
220</table>220</table>
221+ 
222+## Unused Indexes
223+ 
224+筛选begin/end快照之间idx_scan增量为0的用户索引(排除系统schema,与User index stats相同规则)。数据库、节点范围报表,cluster模式和node模式下的detail或all报告可查看,最多200行。
225+ 
226+**表 4 Unused Indexes报表主要内容**
227+ 
228+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>列名称</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>描述</strong></p></th></tr></thead>
229+<tbody>
230+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>DB Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Database名称。</p></td></tr>
231+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Schema</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>Schema名称。</p></td></tr>
232+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Table Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>表名称。</p></td></tr>
233+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Index Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>索引名称。</p></td></tr>
234+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Total Index Scans</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>结束快照时刻的累计索引扫描次数(非区间差分)。</p></td></tr>
235+</tbody>
236+</table>
@@ -143,3 +143,23 @@ SQL Statistics列名称及描述如下表所示。
143</tr>143</tr>
144</tbody>144</tbody>
145</table>145</table>
146+ 
147+## SQL Stats by Database
148+ 
149+按数据库聚合Unique SQL完成路径上的执行次数与总耗时,并计算占实例DB_TIME的比例。节点范围报表,仅node模式下的detail或all报告可查看。需开启Unique SQL相关能力。
150+ 
151+数据来源:snapshot.snap_summary_database_sql_stat(由dbe_perf.summary_database_sql_stat / dbe_perf.database_sql_stat采集)。
152+ 
153+**表 2 SQL Stats by Database报表主要内容**
154+ 
155+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>列名称</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>描述</strong></p></th></tr></thead>
156+<tbody>
157+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>DB Name</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>数据库名称。</p></td></tr>
158+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Exec Count</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>区间内该库SQL执行次数差分。</p></td></tr>
159+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Total Time(s)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>区间内总耗时(秒)。</p></td></tr>
160+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>Avg Time(ms)</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>平均耗时(毫秒);Exec Count为0时为0。</p></td></tr>
161+<tr><td class="cellrowborder" valign="top" width="19.91%" headers="h0 "><p>% of DB Time</p></td><td class="cellrowborder" valign="top" width="80.09%" headers="h1 "><p>相对实例DB_TIME差分的百分比。</p></td></tr>
162+</tbody>
163+</table>
164+ 
165+仅输出Exec Count或总耗时差分大于0的库,按Total Time降序排列。
@@ -0,0 +1,18 @@
1+# SUMMARY\_DATABASE\_SQL\_STAT
2+ 
3+提供openGauss中各正常节点按数据库聚合的SQL执行统计(字段含义见[DATABASE\_SQL\_STAT](database_sql_stat.md))。数据由`dbe_perf.get_summary_database_sql_stat()`汇总各节点`database_sql_stat`得到,是WDR快照表`snap_summary_database_sql_stat`的采集来源。
4+ 
5+**表 1** SUMMARY\_DATABASE\_SQL\_STAT字段
6+ 
7+<table><thead align="left"><tr>
8+<th class="cellrowborder" valign="top" width="17.27%"><p><strong>名称</strong></p></th>
9+<th class="cellrowborder" valign="top" width="16.8%"><p><strong>类型</strong></p></th>
10+<th class="cellrowborder" valign="top" width="65.93%"><p><strong>描述</strong></p></th>
11+</tr></thead>
12+<tbody>
13+<tr><td class="cellrowborder" valign="top"><p>node_name</p></td><td class="cellrowborder" valign="top"><p>text</p></td><td class="cellrowborder" valign="top"><p>节点名称。</p></td></tr>
14+<tr><td class="cellrowborder" valign="top"><p>datid</p></td><td class="cellrowborder" valign="top"><p>oid</p></td><td class="cellrowborder" valign="top"><p>数据库OID。</p></td></tr>
15+<tr><td class="cellrowborder" valign="top"><p>datname</p></td><td class="cellrowborder" valign="top"><p>name</p></td><td class="cellrowborder" valign="top"><p>数据库名称。</p></td></tr>
16+<tr><td class="cellrowborder" valign="top"><p>n_calls</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>该库累计SQL执行次数。</p></td></tr>
17+<tr><td class="cellrowborder" valign="top"><p>total_elapse_time</p></td><td class="cellrowborder" valign="top"><p>bigint</p></td><td class="cellrowborder" valign="top"><p>该库累计SQL总耗时(微秒)。</p></td></tr>
18+</tbody></table>
@@ -143,3 +143,44 @@ Time Model名称及描述如下表所示。
143</tr>143</tr>
144</tbody>144</tbody>
145</table>145</table>
146+ 
147+## Protocol Message Statistics
148+ 
149+WDR 报告中对应模块标题为 **Protocol Statistics**,表标题为 **Protocol Message Statistics**。
150+ 
151+按协议报文类型统计 begin/end 快照区间内的执行次数与耗时,并计算占实例 DB_TIME 的比例。数据来自 `snapshot.snap_global_instance_time`(`snap_value` / `snap_n_calls`),与 Time Model 同源。节点范围报表,仅 node 模式下的 detail 或 all 报告可查看。
152+ 
153+**表 2 协议报文类型映射**
154+ 
155+<table><thead align="left"><tr>
156+<th class="cellrowborder" valign="top" width="8%" id="h0"><p><strong>序号</strong></p></th>
157+<th class="cellrowborder" valign="top" width="22%" id="h1"><p><strong>报告显示名(Message Type)</strong></p></th>
158+<th class="cellrowborder" valign="top" width="28%" id="h2"><p><strong>内部 stat_name</strong></p></th>
159+<th class="cellrowborder" valign="top" width="42%" id="h3"><p><strong>组件含义</strong></p></th>
160+</tr></thead>
161+<tbody>
162+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>1</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Simple Query</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT2_SIMPLE_QUERY</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>简单查询协议路径(Q 报文)耗时与执行次数</p></td></tr>
163+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>2</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Parse</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT6_P</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Parse 阶段</p></td></tr>
164+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>3</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Bind</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT7_B</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Bind 阶段</p></td></tr>
165+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>4</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Execute</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT8_E</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Execute 阶段</p></td></tr>
166+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>5</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Describe</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT9_D</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Describe 阶段</p></td></tr>
167+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>6</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Sync</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT10_S</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Sync 阶段</p></td></tr>
168+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>7</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Close</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT11_C</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>扩展查询 Close 阶段</p></td></tr>
169+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>8</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>Batch Bind-Execute</p></td><td class="cellrowborder" valign="top" headers="h2 "><p>精确匹配 SRT12_U</p></td><td class="cellrowborder" valign="top" headers="h3 "><p>批量 Bind-Execute(U 报文)路径耗时与执行次数</p></td></tr>
170+</tbody>
171+</table>
172+ 
173+ 
174+**表 3 Protocol Message Statistics报表主要内容**
175+ 
176+<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="19.91%" id="h0"><p><strong>列名称</strong></p></th><th class="cellrowborder" valign="top" width="80.09%" id="h1"><p><strong>描述</strong></p></th></tr></thead>
177+<tbody>
178+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Message Type</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>协议报文类型(见上表)。</p></td></tr>
179+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Exec Count</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>区间内该报文类型的执行次数差分(end − begin 的 n_calls)。</p></td></tr>
180+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Total Time(s)</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>区间内总耗时(秒,由微秒差分换算)。</p></td></tr>
181+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>Avg Time(ms)</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>平均耗时(毫秒);Exec Count 为 0 时为 0。</p></td></tr>
182+<tr><td class="cellrowborder" valign="top" headers="h0 "><p>% of DB Time</p></td><td class="cellrowborder" valign="top" headers="h1 "><p>相对实例 DB_TIME 差分的百分比。</p></td></tr>
183+</tbody>
184+</table>
185+ 
186+按 Total Time 降序排列;无对应报文活动时 Exec Count / 耗时可为 0。
@@ -3,3 +3,8 @@
3WDR Snapshot数据表命名原则:snap\_\{源数据表\}。3WDR Snapshot数据表命名原则:snap\_\{源数据表\}。
4 4 
5WDR Snapshot数据表来源为[DBE\_PERF Schema](dbe_perf_schema.md)下的视图。5WDR Snapshot数据表来源为[DBE\_PERF Schema](dbe_perf_schema.md)下的视图。
6+ 
7+与本特性相关的新增/扩展说明:
8+ 
9+- `snap_global_instance_time` 增加 `snap_n_calls` 字段,对应 `pv_instance_time` / `dbe_perf.instance_time` 的 `n_calls`,供 Protocol Message Statistics 等差分统计使用。
10+- 新增 `snap_summary_database_sql_stat`,来源为 `dbe_perf.summary_database_sql_stat`,供 SQL Stats by Database 使用。
@@ -48,7 +48,7 @@ WDR报表主要内容如下表所示。
48</tr>48</tr>
49<tr id="row1212013312166"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p7991716336"><a name="p7991716336"></a><a name="p7991716336"></a><a href="memory_statistics.md">Memory Statistics</a></p>49<tr id="row1212013312166"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p7991716336"><a name="p7991716336"></a><a name="p7991716336"></a><a href="memory_statistics.md">Memory Statistics</a></p>
50</td>50</td>
51-<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul4459131414205"></a><a name="ul4459131414205"></a><ul id="ul4459131414205"><li>内核内存使用分布。</li><li>节点范围报表,仅node模式下可查看此报表。</li></ul>51+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul4459131414205"></a><a name="ul4459131414205"></a><ul id="ul4459131414205"><li>内核内存使用分布,以及关键共享内存组件占用与占比。</li><li>节点范围报表,仅node模式下可查看此报表。</li></ul>
52</td>52</td>
53</tr>53</tr>
54<tr id="row1213317120167"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p1316142615558"><a name="p1316142615558"></a><a name="p1316142615558"></a><a href="time_model.md">Time Model</a></p>54<tr id="row1213317120167"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p1316142615558"><a name="p1316142615558"></a><a name="p1316142615558"></a><a href="time_model.md">Time Model</a></p>
@@ -56,6 +56,11 @@ WDR报表主要内容如下表所示。
56<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul16141716192014"></a><a name="ul16141716192014"></a><ul id="ul16141716192014"><li>节点范围的语句的时间分布信息。</li><li>节点范围报表,仅node模式下可查看此报表。</li></ul>56<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul16141716192014"></a><a name="ul16141716192014"></a><ul id="ul16141716192014"><li>节点范围的语句的时间分布信息。</li><li>节点范围报表,仅node模式下可查看此报表。</li></ul>
57</td>57</td>
58</tr>58</tr>
59+<tr id="row-protocol-message-stat"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p><a href="time_model.md#protocol-message-statistics">Protocol Statistics</a></p>
60+</td>
61+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><ul><li>按协议报文类型(Simple Query / Parse / Bind / Execute / Describe / Sync / Close / Batch Bind-Execute)统计执行次数与耗时及占 DB_TIME 比例。</li><li>节点范围报表,仅node模式下的detail或all报告可查看。</li></ul>
62+</td>
63+</tr>
59<tr id="row849110591151"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p148180593320"><a name="p148180593320"></a><a name="p148180593320"></a><a href="sql_statistics.md">SQL Statistics</a></p>64<tr id="row849110591151"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p148180593320"><a name="p148180593320"></a><a name="p148180593320"></a><a href="sql_statistics.md">SQL Statistics</a></p>
60</td>65</td>
61<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul275315279205"></a><a name="ul275315279205"></a><ul id="ul275315279205"><li>SQL语句各个维度性能统计,按以下维度排序展示:总时间、平均时间、CPU耗时、返回的行数、扫描的行数、执行次数、逻辑读、物理读。</li><li>数据库、节点范围报表,cluster模式和node模式下均可查看此报表。</li></ul>66<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul275315279205"></a><a name="ul275315279205"></a><ul id="ul275315279205"><li>SQL语句各个维度性能统计,按以下维度排序展示:总时间、平均时间、CPU耗时、返回的行数、扫描的行数、执行次数、逻辑读、物理读。</li><li>数据库、节点范围报表,cluster模式和node模式下均可查看此报表。</li></ul>
@@ -78,7 +83,7 @@ WDR报表主要内容如下表所示。
78</tr>83</tr>
79<tr id="row156411451131512"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p12651331239"><a name="p12651331239"></a><a name="p12651331239"></a><a href="object_stats.md">Object stats</a></p>84<tr id="row156411451131512"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p12651331239"><a name="p12651331239"></a><a name="p12651331239"></a><a href="object_stats.md">Object stats</a></p>
80</td>85</td>
81-<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul8257222112020"></a><a name="ul8257222112020"></a><ul id="ul8257222112020"><li>表、索引维度的性能统计信息。</li><li>数据库、节点范围报表,cluster模式和node模式下均可查看此报表。</li></ul>86+<td class="cellrowborder" valign="top" width="74.87%" headers="mcps1.2.3.1.2 "><a name="ul8257222112020"></a><a name="ul8257222112020"></a><ul id="ul8257222112020"><li>表、索引维度的性能统计信息,以及区间内未使用的用户索引。</li><li>数据库、节点范围报表,cluster模式和node模式下均可查看此报表。</li></ul>
82</td>87</td>
83</tr>88</tr>
84<tr id="row8845174912158"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p14537204613311"><a name="p14537204613311"></a><a name="p14537204613311"></a><a href="configuration_settings.md">Configuration settings</a></p>89<tr id="row8845174912158"><td class="cellrowborder" valign="top" width="25.130000000000003%" headers="mcps1.2.3.1.1 "><p id="p14537204613311"><a name="p14537204613311"></a><a name="p14537204613311"></a><a href="configuration_settings.md">Configuration settings</a></p>