doc-exports/docs/dws/dev/dws_04_0463.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

183 lines
16 KiB
HTML

<a name="EN-US_TOPIC_0000001188642164"></a><a name="EN-US_TOPIC_0000001188642164"></a>
<h1 class="topictitle1">Configuration Parameter Hints</h1>
<div id="body1608276293763"><div class="section" id="EN-US_TOPIC_0000001188642164__section6314183673614"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188642164__p1890738133110">A hint, or a GUC hint, specifies a configuration parameter value when a plan is generated.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642164__section16613144810377"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="EN-US_TOPIC_0000001188642164__screen186956873815">set [global](guc_name guc_value)</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642164__section2332184743911"><h4 class="sectiontitle">Parameters</h4><ul id="EN-US_TOPIC_0000001188642164__ul721921684014"><li id="EN-US_TOPIC_0000001188642164__li169711246184711"><strong id="EN-US_TOPIC_0000001188642164__b7657141994918">global</strong> indicates that the parameter set by hint takes effect at the statement level. If <strong id="EN-US_TOPIC_0000001188642164__b266481984911">global</strong> is not specified, the parameter takes effect only in the subquery where the hint is located.</li><li id="EN-US_TOPIC_0000001188642164__li821910163408"><strong id="EN-US_TOPIC_0000001188642164__b725081172615">guc_name</strong> indicates the name of the configuration parameter specified by hint.</li></ul>
<ul id="EN-US_TOPIC_0000001188642164__ul99552335403"><li id="EN-US_TOPIC_0000001188642164__li1195543315403"><strong id="EN-US_TOPIC_0000001188642164__b68648332610">guc_value</strong> indicates the value of a configuration parameter specified by hint.</li></ul>
<div class="note" id="EN-US_TOPIC_0000001188642164__note2495444194116"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188642164__ul34026593410"><li id="EN-US_TOPIC_0000001188642164__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_0000001188642164__b1426113610367">UNION</strong>, <strong id="EN-US_TOPIC_0000001188642164__b12353163920361">INTERSECT</strong>, <strong id="EN-US_TOPIC_0000001188642164__b740210416369">EXCEPT</strong>, and <strong id="EN-US_TOPIC_0000001188642164__b9688543113616">MINUS</strong> statements, you can write the GUC hint at the statement level to any <strong id="EN-US_TOPIC_0000001188642164__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_0000001188642164__b57201510123710">SELECT</strong> clause that participates in the set operation.</li><li id="EN-US_TOPIC_0000001188642164__li39421582428">When a subquery is pulled up, all GUC hints on the subquery are discarded.</li><li id="EN-US_TOPIC_0000001188642164__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>
<p id="EN-US_TOPIC_0000001188642164__p15317337123314">Currently, GUC hints support only some configuration parameters. Some parameters cannot be configured at the subquery level and can only be configured at the statement level. The following table lists the supported parameters.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188642164__table9619938173819" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Configuration parameters supported by GUC hints</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188642164__row19619163818387"><th align="left" class="cellrowborder" valign="top" width="52.21%" id="mcps1.3.5.2.3.1.1"><p id="EN-US_TOPIC_0000001188642164__p16619173823819">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="47.79%" id="mcps1.3.5.2.3.1.2"><p id="EN-US_TOPIC_0000001188642164__p461915388381">Configured at the Subquery Level (Yes/No)</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188642164__row86192389384"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p16195382383">agg_redistribute_enhancement</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p1619338163814">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row1961933819387"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p10619238143816">best_agg_plan</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p186191938163817">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row2619133816388"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p1619173811386">cost_model_version</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p18619143883813">No</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row461914389385"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p561913823820">cost_param</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p146192383388">No</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row661953816388"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p26191938123810">enable_bitmapscan</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p3619438163810">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row196191238153814"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p1561993810384">enable_broadcast</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p196191938193810">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row11619123815383"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p196191638163814">enable_extrapolation_stats</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p12619103873810">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row1161983816382"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p1161993893812">enable_fast_query_shipping</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p2619193843817">No</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row7619153812382"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p9619153819388">enable_force_vector_engine</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p36192388388">No</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row19619203843819"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p361943819389">enable_hashagg</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p18619193817386">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row16191338103818"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p9620143820386">enable_hashjoin</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p1562010384383">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row18620133813383"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p5620153823816">enable_index_nestloop</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p1062023833813">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row12620238103810"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p1562033814382">enable_indexscan</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p86208383386">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row862063813815"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p166207381381">enable_join_pseudoconst</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p11620173893818">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row106201638163812"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p1562043816381">enable_nestloop</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p136201138193816">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row3620113817386"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p13620238143814">enable_nodegroup_debug</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p7620163853812">No</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row1962093863817"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p16620638193814">enable_partition_dynamic_pruning</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p106201938183816">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row106201538153815"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p76201938113818">enable_sort</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p5620143843815">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row20620038113814"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p5620183823814">enable_vector_engine</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p10620123883817">No</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row11620183816381"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p762018388381">expected_computing_nodegroup</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p3620143819382">No</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row2620738183813"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p15620183812385">force_bitmapand</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p10620123814384">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row206201938203818"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p19620638193816">from_collapse_limit</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p17620103873818">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row1862023816386"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p106201638133815">join_collapse_limit</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p6620738103813">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row3620173811382"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p136206382388">join_num_distinct</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p762043816383">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row186206382385"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p462053811380">qrw_inlist2join_optmode</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p1162016387382">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row662073883817"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p1262063813812">qual_num_distinct</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p7620103818383">Yes</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row2620938173816"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p14620203817387">query_dop</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p962023812382">No</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row2621173814389"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p362173873812">rewrite_rule</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p196211538143813">No</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188642164__row56211738123814"><td class="cellrowborder" valign="top" width="52.21%" headers="mcps1.3.5.2.3.1.1 "><p id="EN-US_TOPIC_0000001188642164__p1562193814384">skew_option</p>
</td>
<td class="cellrowborder" valign="top" width="47.79%" headers="mcps1.3.5.2.3.1.2 "><p id="EN-US_TOPIC_0000001188642164__p462113811386">Yes</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0000001188642164__section10533624154212"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188642164__p24781341174213">Hint the query plan in <a href="dws_04_0455.html#EN-US_TOPIC_0000001188642062__section671421102912">Examples</a> as follows:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188642164__screen1769012916445">explain
select /*+ set global(query_dop 0) */ i_product_name product_name
...</pre>
<p id="EN-US_TOPIC_0000001188642164__p67181253164414">This hint indicates that the <strong id="EN-US_TOPIC_0000001188642164__b1177215233263">query_dop</strong> parameter is set to <strong id="EN-US_TOPIC_0000001188642164__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_0000001188642164__p58781332164513"><span><img id="EN-US_TOPIC_0000001188642164__image1287819329457" src="figure/en-us_image_0000001188642274.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>