forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
28 lines
6.0 KiB
HTML
28 lines
6.0 KiB
HTML
<a name="EN-US_TOPIC_0000001145895003"></a><a name="EN-US_TOPIC_0000001145895003"></a>
|
|
|
|
<h1 class="topictitle1">Configuration Parameter Hints</h1>
|
|
<div id="body1608276293763"><div class="section" id="EN-US_TOPIC_0000001145895003__section6314183673614"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001145895003__p1890738133110">A hint, or a GUC hint, specifies a configuration parameter value when a plan is generated. Currently, only the following parameters are supported:</p>
|
|
</div>
|
|
<ul id="EN-US_TOPIC_0000001145895003__ul71369753618"><li id="EN-US_TOPIC_0000001145895003__li17136187153619">agg_redistribute_enhancement</li><li id="EN-US_TOPIC_0000001145895003__li18637135733715">best_agg_plan</li><li id="EN-US_TOPIC_0000001145895003__li13561139183814">enable_fast_query_shipping</li><li id="EN-US_TOPIC_0000001145895003__li8990210173819">enable_hashagg</li><li id="EN-US_TOPIC_0000001145895003__li125541317193814">enable_hashjoin</li><li id="EN-US_TOPIC_0000001145895003__li1699752111386">enable_indexscan</li><li id="EN-US_TOPIC_0000001145895003__li617372693818">enable_nestloop</li><li id="EN-US_TOPIC_0000001145895003__li014683017389">enable_nodegroup_debug</li><li id="EN-US_TOPIC_0000001145895003__li11873334163814">expected_computing_nodegroup</li><li id="EN-US_TOPIC_0000001145895003__li71143910389">qrw_inlist2join_optmode</li><li id="EN-US_TOPIC_0000001145895003__li427513433386">query_dop</li><li id="EN-US_TOPIC_0000001145895003__li122741147163813">rewrite_rule</li><li id="EN-US_TOPIC_0000001145895003__li14473165113817">skew_option</li></ul>
|
|
<div class="section" id="EN-US_TOPIC_0000001145895003__section16613144810377"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="EN-US_TOPIC_0000001145895003__screen186956873815">set [global](guc_name guc_value)</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145895003__section2332184743911"><h4 class="sectiontitle">Parameters</h4><ul id="EN-US_TOPIC_0000001145895003__ul721921684014"><li id="EN-US_TOPIC_0000001145895003__li169711246184711"><strong id="EN-US_TOPIC_0000001145895003__b11398112771813">global</strong> indicates that the parameter set by hint takes effect at the statement level. If <strong id="EN-US_TOPIC_0000001145895003__b108281024133315">global</strong> is not specified, the parameter takes effect only in the subquery where the hint is located.</li><li id="EN-US_TOPIC_0000001145895003__li821910163408"><strong id="EN-US_TOPIC_0000001145895003__b725081172615">guc_name</strong> indicates the name of the configuration parameter specified by hint.</li></ul>
|
|
<ul id="EN-US_TOPIC_0000001145895003__ul99552335403"><li id="EN-US_TOPIC_0000001145895003__li1195543315403"><strong id="EN-US_TOPIC_0000001145895003__b68648332610">guc_value</strong> indicates the value of a configuration parameter specified by hint.</li></ul>
|
|
<div class="note" id="EN-US_TOPIC_0000001145895003__note2495444194116"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001145895003__ul34026593410"><li id="EN-US_TOPIC_0000001145895003__li2071723511504">If a parameter set by hint takes effect at the statement level, the hint must be written to the top-level query instead of the subquery. For <strong id="EN-US_TOPIC_0000001145895003__b1426113610367">UNION</strong>, <strong id="EN-US_TOPIC_0000001145895003__b12353163920361">INTERSECT</strong>, <strong id="EN-US_TOPIC_0000001145895003__b740210416369">EXCEPT</strong>, and <strong id="EN-US_TOPIC_0000001145895003__b9688543113616">MINUS</strong> statements, you can write the GUC hint at the statement level to any <strong id="EN-US_TOPIC_0000001145895003__b8209155319366">SELECT</strong> clause that participates in the set operation. The configuration parameters set by the GUC hint take effect on each <strong id="EN-US_TOPIC_0000001145895003__b57201510123710">SELECT</strong> clause that participates in the set operation.</li><li id="EN-US_TOPIC_0000001145895003__li39421582428">When a subquery is pulled up, all GUC hints on the subquery are discarded.</li><li id="EN-US_TOPIC_0000001145895003__li1648712867">The <strong id="EN-US_TOPIC_0000001145895003__b91691224578">enable_fast_query_shipping</strong>, <strong id="EN-US_TOPIC_0000001145895003__b1367666195712">enable_nodegroup_debug</strong>, <strong id="EN-US_TOPIC_0000001145895003__b12835121114575">expected_computing_nodegroup</strong>, <strong id="EN-US_TOPIC_0000001145895003__b10789191515577">query_dop</strong>, and <strong id="EN-US_TOPIC_0000001145895003__b66501732175720">rewrite_rule</strong> parameters can be set only at the statement level.</li><li id="EN-US_TOPIC_0000001145895003__li234519247266">If a parameter is set by both the statement-level GUC hint and the subquery-level GUC hint, the subquery-level GUC hint takes effect in the corresponding subquery, and the statement-level GUC hint takes effect in other subqueries of the statement.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001145895003__section10533624154212"><h4 class="sectiontitle">Example</h4><p id="EN-US_TOPIC_0000001145895003__p24781341174213">Hint the query plan in <a href="dws_04_0455.html#EN-US_TOPIC_0000001098974750__section671421102912">Examples</a> as follows:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001145895003__screen1769012916445">explain
|
|
select /*+ set global(query_dop 0) */ i_product_name product_name
|
|
...</pre>
|
|
<p id="EN-US_TOPIC_0000001145895003__p67181253164414">This hint indicates that the <strong id="EN-US_TOPIC_0000001145895003__b1177215233263">query_dop</strong> parameter is set to <strong id="EN-US_TOPIC_0000001145895003__b13778142382611">0</strong> when the plan for a statement is generated, which means the SMP adaptation function is enabled. The generated plan is as follows:</p>
|
|
<p id="EN-US_TOPIC_0000001145895003__p58781332164513"><span><img id="EN-US_TOPIC_0000001145895003__image1287819329457" src="figure/en-us_image_0000001145695193.png"></span></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0454.html">Hint-based Tuning</a></div>
|
|
</div>
|
|
</div>
|
|
|