doc-exports/docs/dws/dev/dws_04_0911.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

60 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0000001233883287"></a><a name="EN-US_TOPIC_0000001233883287"></a>
<h1 class="topictitle1">Genetic Query Optimizer</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001233883287__ac6a343c889744cebbd199b2f42d48a5a">This section describes parameters related to genetic query optimizer. The genetic query optimizer (GEQO) is an algorithm that plans queries by using heuristic searching. This algorithm reduces planning time for complex queries and the cost of producing plans are sometimes inferior to those found by the normal exhaustive-search algorithm.</p>
<div class="section" id="EN-US_TOPIC_0000001233883287__s3dd0bac813284472900e16707165891a"><h4 class="sectiontitle">geqo</h4><p id="EN-US_TOPIC_0000001233883287__a668c78340b7a44fd84dcf65605b25d53"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b53033775">Parameter description</strong>: Controls the use of genetic query optimization.</p>
<p id="EN-US_TOPIC_0000001233883287__p9263134511"><strong id="EN-US_TOPIC_0000001233883287__b255511177124">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001233883287__a3ae0f13b5c0b4c94852633a5dd60113a"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b55121625">Value range</strong>: Boolean</p>
<ul id="EN-US_TOPIC_0000001233883287__u60cfe4c5adfa485197468843fccf4769"><li id="EN-US_TOPIC_0000001233883287__l10a66abec62f4ddea022c8c3f80d5b14"><strong>on</strong> indicates GEQO is enabled.</li><li id="EN-US_TOPIC_0000001233883287__l8064777014974712aa4e9a49b20b3707"><strong>off</strong> indicates GEQO is disabled.</li></ul>
<p id="EN-US_TOPIC_0000001233883287__ac9aac18d40ed4a77a9f0bf2cee31c029"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778871_en-us_topic_0058967732_b6125520212036_2">Default value</strong>: <strong id="EN-US_TOPIC_0000001233883287__b842352706152029">on</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001233883287__n0a529c735aca464ea9d0bc41b29d234f"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001233883287__a672eea78fc9f415fb04ae125f3036e38">Generally, do not set this parameter to <strong id="EN-US_TOPIC_0000001233883287__b842352706172047">off</strong>. <strong>geqo_threshold</strong> provides more subtle control of GEQO.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001233883287__sedf64f20bdec49aeae4c4f927cfdb3b4"><h4 class="sectiontitle">geqo_threshold</h4><p id="EN-US_TOPIC_0000001233883287__ab68d1849f14c4c2381485b7c25b4898d"><strong>Parameter description:</strong> Specifies the number of <strong>FROM</strong> items. Genetic query optimization is used to plan queries when the number of statements executed is greater than this value.</p>
<p id="EN-US_TOPIC_0000001233883287__p11463101175210"><strong id="EN-US_TOPIC_0000001233883287__b148313204120">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001233883287__a5121f87d63b141d2ae94330a42dac832"><strong>Value range</strong>: an integer ranging from 2 to INT_MAX</p>
<p id="EN-US_TOPIC_0000001233883287__a923229d441274a399e666fcf543e6227"><strong id="EN-US_TOPIC_0000001233883287__b842352706172643">Default value</strong>: <strong id="EN-US_TOPIC_0000001233883287__b842352706172646">12</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001233883287__n273a96b33fbb470d80a15add7f3213a0"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001233883287__u5a8ab86af1e247108b7a28ccdf0c6a0f"><li id="EN-US_TOPIC_0000001233883287__lbf997267d7cf43c981fd21633bc7c6f3">For simpler queries it is best to use the regular, exhaustive-search planner, but for queries with many tables it is better to use GEQO to manage the queries.</li><li id="EN-US_TOPIC_0000001233883287__le781610111cb4169aaaa5e244377079b">A <strong>FULL OUTER JOIN</strong> construct counts as only one <strong>FROM</strong> item.</li></ul>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001233883287__sd12595645e2245b29684f595140bfdf9"><h4 class="sectiontitle">geqo_effort</h4><p id="EN-US_TOPIC_0000001233883287__a6c06bca326254f2399948a3b224c37bb"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b12982546">Parameter description</strong>: Controls the trade-off between planning time and query plan quality in GEQO.</p>
<p id="EN-US_TOPIC_0000001233883287__p122841138334"><strong id="EN-US_TOPIC_0000001233883287__b4655151213136">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001233883287__a1cf3bd862f1d4210826dc1c5b393d00d"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b54485399">Value range</strong>: an integer ranging from 1 to 10</p>
<p id="EN-US_TOPIC_0000001233883287__ae4f3abf4d9814e63bfee6d1a87394a81"><strong id="EN-US_TOPIC_0000001233883287__b5750214">Default value</strong>: <strong id="EN-US_TOPIC_0000001233883287__b84235270617717">5</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001233883287__n3bb53bbcffe94878b6e459d2f675734f"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001233883287__ul7663134113310"><li id="EN-US_TOPIC_0000001233883287__li12663541133315">Larger values increase the time spent in query planning, but also increase the probability that an efficient query plan is chosen.</li><li id="EN-US_TOPIC_0000001233883287__li166641341183311"><strong id="EN-US_TOPIC_0000001233883287__b8636193351313">geqo_effort</strong> does not have direct effect. This parameter is only used to compute the default values for the other variables that influence GEQO behavior. You can manually set other parameters as required.</li></ul>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001233883287__sfd7a8ba0d06d4fd290fceeb0d60c0cf9"><h4 class="sectiontitle">geqo_pool_size</h4><p id="EN-US_TOPIC_0000001233883287__ad9ebdc62f6b34bf5a1d2149f8f82d7f8"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b41063773">Parameter description</strong>: Specifies the pool size used by GEQO, that is, the number of individuals in the genetic population.</p>
<p id="EN-US_TOPIC_0000001233883287__p3444181065214"><strong id="EN-US_TOPIC_0000001233883287__b20329522111219">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001233883287__a2baf75f1bed4434198c2c7799ac9ca50"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b54205967">Value range</strong>: an integer ranging from 0 to INT_MAX</p>
<div class="notice" id="EN-US_TOPIC_0000001233883287__nbb5d0dadc003498689c50b17ca39de9d"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001233883287__afe714706f6f446ae92b196e084b45fb6">The value of this parameter must be at least <strong id="EN-US_TOPIC_0000001233883287__b14905105510229">2</strong>, and useful values are typically from <strong id="EN-US_TOPIC_0000001233883287__b59091555152211">100</strong> to <strong id="EN-US_TOPIC_0000001233883287__b15910125552216">1000</strong>. If this parameter is set to <strong id="EN-US_TOPIC_0000001233883287__b9579171675317">0</strong>, <span id="EN-US_TOPIC_0000001233883287__text424013293">GaussDB(DWS)</span> selects a proper value based on <strong id="EN-US_TOPIC_0000001233883287__b1644914248549">geqo_effort</strong> and the number of tables.</p>
</div></div>
<p id="EN-US_TOPIC_0000001233883287__a30fdccc70ab343bf960b3f8b2780901b"><strong id="EN-US_TOPIC_0000001233883287__b456912315236">Default value</strong>: <strong id="EN-US_TOPIC_0000001233883287__b1357033122318">0</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001233883287__s4cc4d60a48194654abb74652ef15295e"><h4 class="sectiontitle">geqo_generations</h4><p id="EN-US_TOPIC_0000001233883287__aa1b315f3930c4883ba3590cd4eaf1b9e"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_a3349267c3ab24077858ee6bf2f92f1a9">Parameter description</strong>: Specifies the number parameter iterations of the algorithm used by GEQO.</p>
<p id="EN-US_TOPIC_0000001233883287__p4781315185212"><strong id="EN-US_TOPIC_0000001233883287__b1561142216129">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001233883287__a2314cf804a774834a099122ec8398726"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b3203802">Value range</strong>: an integer ranging from 0 to INT_MAX</p>
<div class="notice" id="EN-US_TOPIC_0000001233883287__nde23964518d94ba3a98e688aad797b7a"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001233883287__a2a0b848dcc0a4086a5e88a42f0dc4829">The value of this parameter must be at least <strong>1</strong>, and useful values are typically from <strong>100</strong> to <strong>1000</strong>. If it is set to <strong id="EN-US_TOPIC_0000001233883287__b842352706135339">0</strong>, a suitable value is chosen based on <strong id="EN-US_TOPIC_0000001233883287__b842352706135351">geqo_pool_size</strong>.</p>
</div></div>
<p id="EN-US_TOPIC_0000001233883287__ae6fa4399e97f4e49bb9eba80a1c5571d"><strong id="EN-US_TOPIC_0000001233883287__b29948419">Default value</strong>: <strong id="EN-US_TOPIC_0000001233883287__b84235270617431">0</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001233883287__s0c7e71a21b9241899cbebe59a0782335"><h4 class="sectiontitle">geqo_selection_bias</h4><p id="EN-US_TOPIC_0000001233883287__ad33946a5349742e68c698cf673d3ca50"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b55211183">Parameter description</strong>: Specifies the selection bias used by GEQO. The selection bias is the selective pressure within the population.</p>
<p id="EN-US_TOPIC_0000001233883287__p141133206529"><strong id="EN-US_TOPIC_0000001233883287__b1879382215124">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001233883287__aac5fb269f33344b991e914967aad1410"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b940142">Value range</strong>: a floating point number ranging from 1.5 to 2.0</p>
<p id="EN-US_TOPIC_0000001233883287__a380ba89e433d46ab8480b0c2a9fdc5c3"><strong id="EN-US_TOPIC_0000001233883287__b842352706142823">Default value</strong>: <strong id="EN-US_TOPIC_0000001233883287__b842352706142826">2</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001233883287__s6d083be3aa1d41dbb86c2c732de24cff"><h4 class="sectiontitle">geqo_seed</h4><p id="EN-US_TOPIC_0000001233883287__a9b395c3a9893458798f81b892b90c7a1"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b19873515">Parameter description</strong>: Specifies the initial value of the random number generator used by GEQO to select random paths through the join order search space.</p>
<p id="EN-US_TOPIC_0000001233883287__p645142575219"><strong id="EN-US_TOPIC_0000001233883287__b1596742219123">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001233883287__aeaf0e7983271491c9c762690c6f7df28"><strong id="EN-US_TOPIC_0000001233883287__en-us_topic_0059778564_en-us_topic_0058967768_b47346499">Value range</strong>: a floating point number ranging from 0.0 to 1.0</p>
<div class="notice" id="EN-US_TOPIC_0000001233883287__n263f74ae65d14de096a3d33c2bb9585a"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001233883287__ab57316c2451446c9b462336b247a7298">Varying the value changes the setting of join paths explored, and may result in a better or worse path being found.</p>
</div></div>
<p id="EN-US_TOPIC_0000001233883287__ae34f277d05a2423fb00df1ebe4bfb6a7"><strong id="EN-US_TOPIC_0000001233883287__b1328810520">Default value</strong>: <strong id="EN-US_TOPIC_0000001233883287__b598578865">0</strong></p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0908.html">Query Planning</a></div>
</div>
</div>