forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: luhuayi <luhuayi@huawei.com> Co-committed-by: luhuayi <luhuayi@huawei.com>
177 lines
38 KiB
HTML
177 lines
38 KiB
HTML
<a name="EN-US_TOPIC_0000002052813834"></a><a name="EN-US_TOPIC_0000002052813834"></a>
|
||
|
||
<h1 class="topictitle1">Query Band Load Identification</h1>
|
||
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_section71602015020"><h4 class="sectiontitle">Overview</h4><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p103026119581"><span id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_text33021811145810">GaussDB(DWS)</span> implements load identification and intra-queue priority control based on query_band. It provides more flexible load identification methods and identifies load queues based on job types, application names, and script names. Users can flexibly configure query_band identification queues based on service scenarios. In addition, priority control of job delivery in the queue is implemented. In the future, priority control of resources in the queue will be gradually implemented.</p>
|
||
<p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p1570284418546">Administrators can configure the queue associated with query_band and estimate the memory limit based on service scenarios and job types to implement more flexible load control and resource management and control. If query_band is not configured for the service or the user does not associate query_band with an action, the queue associated with the user and the priority in the queue is used by default.</p>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_section1576443115720"><h4 class="sectiontitle">Load Behaviors Supported by query_band</h4><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p1137915448184">query_band is a session-level GUC parameter. It is a job identifier of the character data type. Its value can be any string. However, for easier differentiation and configuration, query_band only identifies key-value pairs. For example:</p>
|
||
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen127413610369"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SET</span><span class="w"> </span><span class="n">query_band</span><span class="o">=</span><span class="s1">'JobName=abc;AppName=test;UserName=user'</span><span class="p">;</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
<p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p1277916331285"><strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b175851640123712">JobName=abc</strong>, <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b958624093720">AppName=test</strong>, and <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b11586184083715">UserName=user</strong> are independent key-value pairs. Specifications of the query_band key-value pairs:</p>
|
||
<ul id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ul6361102218319"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1236162219315">query_band is set in key-value pair mode, that is, 'key=value'. Multiple query_band key-value pairs can be set in a session. Multiple key-value pairs are separated by semicolons (;). The maximum length of both the <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b62541281417">query_band</strong> key-value pair and parameter value is 1024 characters.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li0610723153111">The query_band key-value pair supports the following valid characters: digits 0 to 9, uppercase letters A to Z, lowercase letters a to z, '.', '-', '_', and '#'.<p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p6732048203213"><a name="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li0610723153111"></a><a name="en-us_topic_0000001811609577_li0610723153111"></a></p>
|
||
</li></ul>
|
||
<p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p11601511165812">query_band is configured, and identifies load behaviors, using key-value pairs. The supported load behaviors are described in <a href="#EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_table107259598574">Table 1</a>.</p>
|
||
|
||
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_table107259598574"></a><a name="en-us_topic_0000001811609577_table107259598574"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_table107259598574" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Load behaviors supported by QUERY_BAND</caption><thead align="left"><tr id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_row972511593573"><th align="left" class="cellrowborder" valign="top" width="19.63196319631963%" id="mcps1.3.2.7.2.4.1.1"><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p117251659175714">Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="22.042204220422043%" id="mcps1.3.2.7.2.4.1.2"><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p7725259195712">Behavior</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="58.32583258325833%" id="mcps1.3.2.7.2.4.1.3"><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p19725059105714">Behavior Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_row19726165915716"><td class="cellrowborder" valign="top" width="19.63196319631963%" headers="mcps1.3.2.7.2.4.1.1 "><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p9726195919573">Workload management (workload)</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="22.042204220422043%" headers="mcps1.3.2.7.2.4.1.2 "><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p672614590572">Resource pool (respool)</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="58.32583258325833%" headers="mcps1.3.2.7.2.4.1.3 "><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p1172695914578">query_band associated with a resource pool</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_row18726155945719"><td class="cellrowborder" valign="top" width="19.63196319631963%" headers="mcps1.3.2.7.2.4.1.1 "><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p13726135914572">Workload management (workload)</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="22.042204220422043%" headers="mcps1.3.2.7.2.4.1.2 "><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p12726259125717">Priority</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="58.32583258325833%" headers="mcps1.3.2.7.2.4.1.3 "><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p8726259165718">Priority in the queue</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_row1072618591574"><td class="cellrowborder" valign="top" width="19.63196319631963%" headers="mcps1.3.2.7.2.4.1.1 "><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p872665910570">Order</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="22.042204220422043%" headers="mcps1.3.2.7.2.4.1.2 "><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p7726059115719">Queue (respool)</p>
|
||
<p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p1972695945719">Currently, this field is invalid and is used for future extension.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="58.32583258325833%" headers="mcps1.3.2.7.2.4.1.3 "><p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p372635905719"><strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b1845195712815">query_band</strong> query order</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p7822134117343">The "Type" is used to classify load behaviors. Different load behaviors may belong to a same type. For example, both "Resource pool" and a "Priority" belong to "Workload management". The "Behavior" indicates a load behavior associated with a query_band key-value pair. The "Behavior description" describes a specific load behavior. The "Order" in the "Type" is used to indicate the priority of the query_band load behavior identification. When a session has multiple query_band key-value pairs, the query_band key-value pair with a smaller order value is preferentially used to identify a load behavior. Each query_band key-value pair can have multiple associated load behaviors, while one load behavior can only have one associated key-value pair. The query_band load behavior is described as follows:</p>
|
||
<ul id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ul11841214105913"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li163118211162">Resource pool: query_band can be associated with resource pools. During job execution, if a resource pool is associated with query_band, the resource pool is used in preference. Otherwise, the resource pool associated with the user is used.<ul id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ul9311142114617"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li53114212614">When query_band is associated with a resource pool, an error is reported if the resource pool does not exist, and the association fails.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1131111214613">When query_band is associated with a resource pool, the dependency between query_band and the resource pool is recorded.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li53117212065">When a resource pool associated with query_band is deleted, a message is displayed indicating that the resource pool fails to be deleted because of the dependency between query_band and the resource pool.</li></ul>
|
||
</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li17311112112620">Intra-queue priority: query_band can be associated with job priorities, including high, medium, and low. Rush is provided as a special priority (green channel). The default priority is medium. In practice, most jobs use the medium priority, low-priority jobs use the low priority, and privileged jobs use the high priority. It is not recommended that a large number of jobs use the high priority. The rush priority is used only in special scenarios and is not recommended in normal cases.<p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p331118211965"><a name="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li17311112112620"></a><a name="en-us_topic_0000001811609577_li17311112112620"></a>The intra-queue priority is used to implement the queuing priority.</p>
|
||
<ul id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ul23116215615"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li103114213619">In the static load management scenario, when the CN concurrency is insufficient, CN global queuing is triggered. The CN global queue is a priority queue.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li0311421368">In the dynamic load management scenario, if the DN memory is insufficient, CCN global queuing is triggered. The CCN global queue is a priority queue.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1531115219614">When the resource pool concurrency or memory is insufficient, resource pool queuing is triggered. The resource pool queue is a priority queue.</li></ul>
|
||
<p id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_p3311142119610">The preceding priority queues comply with the following scheduling rules:</p>
|
||
<ul id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ul1131116214612"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li631118217619">Jobs with a higher priority are scheduled first.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li203111821664">After all jobs with a high priority are scheduled, jobs with a low priority are scheduled.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li20311132117614">In dynamic load management scenarios, the CN global queue does not support the query_band priority.</li></ul>
|
||
</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li531114211262">Order: The identification order of query_bands can be configured. The default order value is <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b3549104173618">-1</strong>. Except the default order value, there are no two query_bands with the same order value. The query_band order is verified when being configured. If there are query_bands with the same order value, the order values are recursively increased by 1 until there are no query_bands with the same order value.<ul id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ul1797201318415"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li85077238413">If a session has multiple query_band key-value pairs, the query_band key-value pair with a smaller order value is used for load identification.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li9876928644"><strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b18547186469">0</strong> is the smallest order value, and the default order value <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b694021211461">-1</strong> is the largest order value.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li189026328419">If the query_bands are all of the same order value, the anterior query_band is used for load identification.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1298161311412">For example, if in <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b147064115719">set query_band='b=1;a=3;c=1'; b=1</strong>, the order value of <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b6832322398">b=1</strong> is <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b1346103020918">-1</strong>, <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b121051857698">a=3</strong> is <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b189034501595">4</strong>, <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b432328131019">c=1</strong> is <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b173161913109">1</strong>, <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b61272573103">c=1</strong> is used as the query_band for load identification. This design enables load administrators to adjust load scheduling.</li></ul>
|
||
</li></ul>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_section1455133168"><h4 class="sectiontitle">Application and Configuration of query_band</h4><ul id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ul377811171368"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1931015212613">The pg_workload_action cross-database system catalog is used to store the query_band action and order. For details, see <a href="dws_04_0632.html">PG_WORKLOAD_ACTION</a>.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li13101421267">The default action and order are not stored in the <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b9715154073219">pg_workload_action</strong> system catalog. If a non-default action is set for query_band, the default action is also displayed when actions are queried. The message <query_band information not found> is displayed when the action and order to be queried are the default query_band action.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li103118211611">The <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b1972116438329">gs_wlm_set_queryband_action</strong> function sets the query_band sequence. The maximum length of the first parameter, that is, the query_band key value pair, is 63 characters. For the second parameter, it is case insensitive and multiple actions are separated by semicolons (;). <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b9721144316322">order</strong> is the default parameter and its default value is <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b37221643103215">-1</strong>. For details, see <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b7660181295719"></strong><strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b113191716165713">gs_wlm_set_queryband_action</strong> in "Resource Management Functions" in <em id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_i95630459568">SQL Syntax</em>.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li83111211466">The <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b924716473336">gs_wlm_set_queryband_order</strong> function sets the query_band sequence. The maximum length of the first parameter, that is, a query_band key value pair, is 63 characters. The value of query_band must be greater than or equal to <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b7255154710338">–1</strong>. Except the default value <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b0255184763314">–1</strong>, the value of query_band order must be unique. When setting the query_band order, if there are query_bands with the same order value, the original order value is increased by 1. For details, see <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b0257162113572"></strong><strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b036893115717">gs_wlm_set_queryband_order</strong> in "Resource Management Functions" in <em id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_i194971142175520">SQL Syntax</em>.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1131192120617">You can use the <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b2067317281582">gs_wlm_get_queryband_action</strong> function to query the <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b166731228115817">query_band</strong> action. For details, see <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b2231915135915"></strong><strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b17448170592">gs_wlm_set_queryband_action</strong> in "Resource Management Functions" in <em id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_i4673628115811">SQL Syntax</em>.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1531112112617"><strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b76611783615">pg_queryband_action</strong> provides the system view for querying all query_band actions. For details, see <a href="dws_04_0743.html">PG_QUERYBAND_ACTION</a>.</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li124251641195019">The query_band priority is displayed as an integer in the load management view (<a href="dws_04_0749.html">PG_SESSION_WLMSTAT</a>). The mapping between numbers and priorities is as follows:<ul id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ul64251441105020"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li18311202117611">0: not controlled by load management</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1331119211062">1: low</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1231112211613">2: medium</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li23111521161">4: high</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li4425141185010">8: rush</li></ul>
|
||
</li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li731122114610">Permission control: Except initial users, other users have the permission to set and query query_band only when they are authorized.</li></ul>
|
||
</div>
|
||
<div class="note" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_note562882014818"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ul1788793612816"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li158871536384">When all running jobs are canceled in batches or the maximum number of concurrent jobs in a queue is 1 and only one queue is running jobs, the CN may be triggered to automatically wake up jobs. As a result, jobs are not delivered by priority.</li></ul>
|
||
</div></div>
|
||
<div class="section" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_section16275945165214"><h4 class="sectiontitle">Examples</h4><ol id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_ol3202331161217"><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li4271811836"><span>Set the associated resource pool to <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b154711991716">p1</strong>, priority to <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b560121518170">rush</strong>, and order to <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b950571814174">1</strong> for query_band <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b4891938121714">JobName to abc</strong>.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen1716111121336"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
||
<span class="normal">2</span>
|
||
<span class="normal">3</span>
|
||
<span class="normal">4</span>
|
||
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_wlm_set_queryband_action</span><span class="p">(</span><span class="s1">'JobName=abc'</span><span class="p">,</span><span class="s1">'respool=p1;priority=rush'</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
|
||
<span class="n">gs_wlm_set_queryband_action</span>
|
||
<span class="c1">-----------------------------</span>
|
||
<span class="w"> </span><span class="n">t</span>
|
||
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
</p></li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li929611271044"><span>Change the associated resource pool to <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b12185218131819">p2</strong> for query_band <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b1597615326180">JobName=abc</strong>.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen166321156964"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
||
<span class="normal">2</span>
|
||
<span class="normal">3</span>
|
||
<span class="normal">4</span>
|
||
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_wlm_set_queryband_action</span><span class="p">(</span><span class="s1">'JobName=abc'</span><span class="p">,</span><span class="s1">'respool=p2'</span><span class="p">);</span>
|
||
<span class="n">gs_wlm_set_queryband_action</span>
|
||
<span class="c1">-----------------------------</span>
|
||
<span class="w"> </span><span class="n">t</span>
|
||
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
</p></li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1397113436717"><span>Change the priority to <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b58162014111913">high</strong> for query_band <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b16811331198">JobName=abc</strong>.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen15971124320710"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
||
<span class="normal">2</span>
|
||
<span class="normal">3</span>
|
||
<span class="normal">4</span>
|
||
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_wlm_set_queryband_action</span><span class="p">(</span><span class="s1">'JobName=abc'</span><span class="p">,</span><span class="s1">'priority=high'</span><span class="p">);</span>
|
||
<span class="n">gs_wlm_set_queryband_action</span>
|
||
<span class="c1">-----------------------------</span>
|
||
<span class="w"> </span><span class="n">t</span>
|
||
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
</p></li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li17568184714116"><span>Change the order to <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b5975183415191">3</strong> for query_band <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b128211329181910">JobName=abc</strong>.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen125681947144113"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
||
<span class="normal">2</span>
|
||
<span class="normal">3</span>
|
||
<span class="normal">4</span>
|
||
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_wlm_set_queryband_order</span><span class="p">(</span><span class="s1">'JobName=abc'</span><span class="p">,</span><span class="mi">3</span><span class="p">);</span>
|
||
<span class="n">gs_wlm_set_queryband_order</span>
|
||
<span class="c1">-----------------------------</span>
|
||
<span class="w"> </span><span class="n">t</span>
|
||
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
</p></li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li486962074913"><span>Query the load behaviors associated with query_band.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen286942010496"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
||
<span class="normal">2</span>
|
||
<span class="normal">3</span>
|
||
<span class="normal">4</span>
|
||
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_queryband_action</span><span class="p">;</span>
|
||
<span class="w"> </span><span class="n">qband</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">respool_id</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">respool</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">priority</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">qborder</span>
|
||
<span class="c1">--------------+------------+---------+----------+---------</span>
|
||
<span class="w"> </span><span class="n">JobName</span><span class="o">=</span><span class="n">abc</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">17119</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">p2</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">high</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">1</span>
|
||
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
</p></li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li183281261017"><span>In <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b1718132962616">query_band</strong>, set the priority of <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b14376145032612">AppName=test</strong> to <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b18338266271">Low</strong>, associate the user with the resource pool, and use the default sequence.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen153283261800"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
||
<span class="normal">2</span>
|
||
<span class="normal">3</span>
|
||
<span class="normal">4</span>
|
||
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_wlm_set_queryband_action</span><span class="p">(</span><span class="s1">'AppName=test'</span><span class="p">,</span><span class="s1">'priority=low'</span><span class="p">);</span>
|
||
<span class="n">gs_wlm_set_queryband_action</span>
|
||
<span class="c1">-----------------------------</span>
|
||
<span class="w"> </span><span class="n">t</span>
|
||
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
</p></li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li19505947215"><span>Query the load behaviors associated with query_band.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen1350512471312"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
||
<span class="normal">2</span>
|
||
<span class="normal">3</span>
|
||
<span class="normal">4</span>
|
||
<span class="normal">5</span>
|
||
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_queryband_action</span><span class="p">;</span>
|
||
<span class="w"> </span><span class="n">qband</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">respool_id</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">respool</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">priority</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">qborder</span>
|
||
<span class="c1">--------------+------------+---------+----------+---------</span>
|
||
<span class="w"> </span><span class="n">AppName</span><span class="o">=</span><span class="n">test</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">NULL</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">low</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="o">-</span><span class="mi">1</span>
|
||
<span class="w"> </span><span class="n">JobName</span><span class="o">=</span><span class="n">abc</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">16754</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">p2</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">high</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">3</span>
|
||
<span class="p">(</span><span class="mi">2</span><span class="w"> </span><span class="k">rows</span><span class="p">)</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
</p></li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li151851263310"><span>In <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b1053016282285">query_band</strong>, cancel all the workload behaviors associated with <strong id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_b33277014297">JobName=abc</strong> and set them to default behaviors.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen71850260310"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
||
<span class="normal">2</span>
|
||
<span class="normal">3</span>
|
||
<span class="normal">4</span>
|
||
<span class="normal">5</span>
|
||
<span class="normal">6</span>
|
||
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">gs_wlm_set_queryband_action</span><span class="p">(</span><span class="s1">'JobName=abc'</span><span class="p">,</span><span class="s1">'respool=null;priority=medium'</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">);</span>
|
||
<span class="n">NOTICE</span><span class="p">:</span><span class="w"> </span><span class="n">The</span><span class="w"> </span><span class="n">respool</span><span class="w"> </span><span class="k">of</span><span class="w"> </span><span class="n">query_band</span><span class="p">(</span><span class="n">JobName</span><span class="o">=</span><span class="n">abc</span><span class="p">)</span><span class="w"> </span><span class="n">will</span><span class="w"> </span><span class="n">be</span><span class="w"> </span><span class="n">removed</span><span class="p">.</span>
|
||
<span class="n">NOTICE</span><span class="p">:</span><span class="w"> </span><span class="n">The</span><span class="w"> </span><span class="n">priority</span><span class="w"> </span><span class="k">of</span><span class="w"> </span><span class="n">query_band</span><span class="p">(</span><span class="n">JobName</span><span class="o">=</span><span class="n">abc</span><span class="p">)</span><span class="w"> </span><span class="n">will</span><span class="w"> </span><span class="n">be</span><span class="w"> </span><span class="n">removed</span><span class="p">.</span>
|
||
<span class="w"> </span><span class="n">gs_wlm_set_queryband_action</span>
|
||
<span class="c1">-----------------------------</span>
|
||
<span class="w"> </span><span class="n">t</span>
|
||
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
</p></li><li id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_li1437814392511"><span>Query the load behaviors associated with query_band.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000002052813834__en-us_topic_0000001811609577_screen1012018712619"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
||
<span class="normal">2</span>
|
||
<span class="normal">3</span>
|
||
<span class="normal">4</span>
|
||
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_queryband_action</span><span class="p">;</span>
|
||
<span class="w"> </span><span class="n">qband</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">respool_id</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">respool</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">priority</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">qborder</span>
|
||
<span class="c1">--------------+------------+---------+----------+---------</span>
|
||
<span class="w"> </span><span class="n">AppName</span><span class="o">=</span><span class="n">test</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">NULL</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">low</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="o">-</span><span class="mi">1</span>
|
||
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
|
||
</pre></div></td></tr></table></div>
|
||
</div>
|
||
</p></li></ol>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0430.html">SQL Tuning</a></div>
|
||
</div>
|
||
</div>
|
||
|