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

155 lines
41 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="EN-US_TOPIC_0000001188163786"></a><a name="EN-US_TOPIC_0000001188163786"></a>
<h1 class="topictitle1">Memory</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001188163786__acbb76234d062444a8720220723f2bae7">This section describes memory parameters.</p>
<div class="notice" id="EN-US_TOPIC_0000001188163786__n1e7f23b49248441192895b90b4c59fe1"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188163786__a9dfe1037d1494d578fb3d6fe9f2bc709">Parameters described in this section take effect only after the database service restarts.</p>
</div></div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s20184c6797a14675b4972596f4875925"><h4 class="sectiontitle">enable_memory_limit</h4><p id="EN-US_TOPIC_0000001188163786__abae5884d428a419ebb2c78cf543a5927"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_a8d0c6925bad24927bf0963c32df90f0f">Parameter description</strong>: Specifies whether to enable the logical memory management module.</p>
<p id="EN-US_TOPIC_0000001188163786__p1323514620588"><strong id="EN-US_TOPIC_0000001188163786__b4105143671610">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001188163786__ac12c69103e05467883bf23ffb1ed8a1b"><strong id="EN-US_TOPIC_0000001188163786__b954765520">Value range</strong>: Boolean</p>
<ul id="EN-US_TOPIC_0000001188163786__u9a55f24d96084db28686c9479ffbdef2"><li id="EN-US_TOPIC_0000001188163786__l6038d602c1534a2085bd0bd7b0756560"><strong id="EN-US_TOPIC_0000001188163786__b8423527061008">on</strong> indicates the logic memory management module is enabled.</li><li id="EN-US_TOPIC_0000001188163786__l30cbadad8bae4eb7a631b7055ef60e68"><strong id="EN-US_TOPIC_0000001188163786__b84235270610032">off</strong> indicates the logic memory management module is disabled.</li></ul>
<p id="EN-US_TOPIC_0000001188163786__p916634113910"><strong id="EN-US_TOPIC_0000001188163786__b11339164413215">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b034012448210">on</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001188163786__note1911124396"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001188163786__ul9954113913364"><li id="EN-US_TOPIC_0000001188163786__li1495411393364">If the value of max_process_memory-max_shared_memory-cstore buffers is less than 2 GB, forcibly set enable_memory_limit to off.</li><li id="EN-US_TOPIC_0000001188163786__li1722804219368">The max_shared_memory parameter is closely related to the shared_buffer, max_connections, and max_prepared_transactions parameters. If the value of max_shared_memory is too large, you can decrease the values of the three parameters.</li><li id="EN-US_TOPIC_0000001188163786__li11412159142716">The dynamic load management function depends on the memory management function. After the <strong id="EN-US_TOPIC_0000001188163786__b17196840101916">enable_memory_limit</strong> parameter is disabled, the dynamic load management and TopSQL functions become invalid.</li></ul>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__sadc1e0e8c1c246a4a6cad3967deebaad"><a name="EN-US_TOPIC_0000001188163786__sadc1e0e8c1c246a4a6cad3967deebaad"></a><a name="sadc1e0e8c1c246a4a6cad3967deebaad"></a><h4 class="sectiontitle">max_process_memory</h4><p id="EN-US_TOPIC_0000001188163786__a53eb6c5bf07b4727aab3e3115a9f50ff"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_af52cec9923704d7b853e747a421a063d">Parameter description</strong>: Specifies the maximum physical memory of a database node.</p>
<p id="EN-US_TOPIC_0000001188163786__p362318577589"><strong id="EN-US_TOPIC_0000001188163786__b5257193601613">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001188163786__a1c994b25be6b47dca23f821f640ff5b5"><strong id="EN-US_TOPIC_0000001188163786__b411610483427">Value range</strong>: an integer ranging from 2 x 1024 x 1024 to INT_MAX/2. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001188163786__a08b4f50bb07d4e17aec84a63c619d652"><strong id="EN-US_TOPIC_0000001188163786__b15361143893">Default value</strong>: The value is automatically adapted on non-secondary DNs. The formula is (Physical memory size) x 0.8/ (1 + Number of primary DNs). If the result is less than 2 GB, 2 GB is used by default. The default size of the secondary DN is 12 GB.</p>
<p id="EN-US_TOPIC_0000001188163786__aab35f3b5765c45d5bef7391ef5ea5e17"><strong id="EN-US_TOPIC_0000001188163786__b415217514913">Setting suggestions:</strong></p>
<p id="EN-US_TOPIC_0000001188163786__aa85d46afebc1485db6a84be96ef7a360">On DNs, the value of this parameter is determined based on the physical system memory and the number of DNs deployed on a single node. Parameter value = (Physical memory <strong id="EN-US_TOPIC_0000001188163786__b84235270618211">vm.min_free_kbytes</strong>) x 0.8/(n + Number of primary DNs). This parameter aims to ensure system reliability, preventing node OOM caused by increasing memory usage. <strong id="EN-US_TOPIC_0000001188163786__b8423527061848">vm.min_free_kbytes</strong> indicates OS memory reserved for kernels to receive and send data. Its value is at least 5% of the total memory. That is, <strong id="EN-US_TOPIC_0000001188163786__b10956594152">max_process_memory</strong> = Physical memory x 0.8/ (n + Number of primary DNs). If the cluster scale (number of nodes in the cluster) is smaller than 256, n=1; if the cluster scale is larger than 256 and smaller than 512, n=2; if the cluster scale is larger than 512, n=3.</p>
<p id="EN-US_TOPIC_0000001188163786__a2c302a331b514dbf86506fa895532a9b">Set this parameter on CNs to the same value as that on DNs.</p>
<p id="EN-US_TOPIC_0000001188163786__aac6651d0559d4f8dbf8f29b67f71f824">RAM is the maximum memory allocated to the cluster.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s9292cfbf38fa4b17b93e9a47330da753"><a name="EN-US_TOPIC_0000001188163786__s9292cfbf38fa4b17b93e9a47330da753"></a><a name="s9292cfbf38fa4b17b93e9a47330da753"></a><h4 class="sectiontitle">shared_buffers</h4><p id="EN-US_TOPIC_0000001188163786__ab13aedfb466945b989a68f6841e03b30"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_a634b4083704d458d8aa1b0625bb017ba">Parameter description</strong>: Specifies the size of shared memory used by <span id="EN-US_TOPIC_0000001188163786__text1290229906">GaussDB(DWS)</span>. If this parameter is set to a large value, <span id="EN-US_TOPIC_0000001188163786__text90725607">GaussDB(DWS)</span> may require more System V shared memory than the default setting.</p>
<p id="EN-US_TOPIC_0000001188163786__p57408820595"><strong id="EN-US_TOPIC_0000001188163786__b540863618164">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001188163786__a26045bf3ea764992b5d7f5205e04a60e"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0085031695_b23455951">Value range</strong>: an integer ranging from 128 to INT_MAX. The unit is 8 KB.</p>
<p id="EN-US_TOPIC_0000001188163786__aa0a8f30f9bb2448ea266e71f4d6f9997">Changing the value of <strong id="EN-US_TOPIC_0000001188163786__b14119131718914">BLCKSZ</strong> will result in a change in the minimum value of the <strong id="EN-US_TOPIC_0000001188163786__b16119171717915">shared_buffers</strong>.</p>
<p id="EN-US_TOPIC_0000001188163786__ab7b3221349934d99a64321c8bee4119b"><strong id="EN-US_TOPIC_0000001188163786__b38693111131">Default value</strong>: The value of CN is half of the value of DN. The value of DN is calculated using the following formula: <strong id="EN-US_TOPIC_0000001188163786__b11579743112614">POWER(2,ROUND(LOG(2, max_process_memory/18),0))</strong>. If the maximum value allowed by the OS is smaller than 32 MB, this parameter will be automatically changed to the maximum value allowed by the OS during database initialization.</p>
<p id="EN-US_TOPIC_0000001188163786__a77837c0b9f6243f79140868c3f0c0441"><strong id="EN-US_TOPIC_0000001188163786__b7839173071018">Setting suggestions:</strong></p>
<p id="EN-US_TOPIC_0000001188163786__a3accc27ef2c54bcd8a43ab2e88485045">You are advised to set this parameter for DNs to a value greater than that for CNs, because <span id="EN-US_TOPIC_0000001188163786__text1842878328">GaussDB(DWS)</span> pushes its most queries down to DNs.</p>
<p id="EN-US_TOPIC_0000001188163786__a65c5d2025fc74e82a32cf6335d2a88b1">It is recommended that <strong id="EN-US_TOPIC_0000001188163786__b361983817108">shared_buffers</strong> be set to a value less than 40% of the memory. Set it to a large value for row-store tables and a small value for column-store tables. For column-store tables: shared_buffers = (Memory of a single server/Number of DNs on the single server) x 0.4 x 0.25</p>
<p id="EN-US_TOPIC_0000001188163786__aa01ec1333ed54e1a9bdd9bf07ac8b8f6">If you want to increase the value of <strong id="EN-US_TOPIC_0000001188163786__b1983551111010">shared_buffers</strong>, you also need to increase the value of <strong id="EN-US_TOPIC_0000001188163786__b1577725311321">checkpoint_segments</strong>, because a longer period of time is required to write a large amount of new or changed data.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__sa113688c33b04423b87e58778af0e6a2"><h4 class="sectiontitle">bulk_write_ring_size</h4><p id="EN-US_TOPIC_0000001188163786__a9b4c49566baa4d0c8bf2fa5d7aa89b6e"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_a5d15f656796e45adbc283eb071726946">Parameter description</strong>: Specifies the size of the ring buffer used for data parallel import.</p>
<p id="EN-US_TOPIC_0000001188163786__p196107204597"><strong id="EN-US_TOPIC_0000001188163786__b8326374167">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__a55ff05c938fa42bfa70a415edab6155e"><strong id="EN-US_TOPIC_0000001188163786__b168391819303">Value range</strong>: an integer ranging from 16384 to INT_MAX. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001188163786__ad69fdc72c7284d399eb23b7c5e7f56aa"><strong id="EN-US_TOPIC_0000001188163786__b573446154754">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b84235270617188">2 GB</strong></p>
<p id="EN-US_TOPIC_0000001188163786__aa6dd6edd27c24a38a68eb246cf0babcb"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_b13212128153737">Setting suggestions</strong>: Increase the value of this parameter on DNs if a huge amount of data is to be imported.</p>
<p id="EN-US_TOPIC_0000001188163786__p149631356103918"></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__section173431114174020"><h4 class="sectiontitle">buffer_ring_ratio</h4><p id="EN-US_TOPIC_0000001188163786__p940681510409"><strong id="EN-US_TOPIC_0000001188163786__b122217101431">Parameter description</strong>: ring buffer threshold for parallel data export</p>
<p id="EN-US_TOPIC_0000001188163786__p34064153406"><strong id="EN-US_TOPIC_0000001188163786__b17982186105416">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__p340641518403"><strong id="EN-US_TOPIC_0000001188163786__b864014011559">Value range</strong>: integer in the range 11000</p>
<p id="EN-US_TOPIC_0000001188163786__p17254337620"><strong id="EN-US_TOPIC_0000001188163786__b42521137155420">Default value</strong>: 250</p>
<div class="note" id="EN-US_TOPIC_0000001188163786__note131812339612"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188163786__ul921193313713"><li id="EN-US_TOPIC_0000001188163786__li921118331779">The default value indicates that the threshold is 250/1000 (a quarter) of <strong id="EN-US_TOPIC_0000001188163786__b1429019566462">shared_buffers</strong>.</li><li id="EN-US_TOPIC_0000001188163786__li62641441475">The minimum value is 1/1000 of the value of <strong id="EN-US_TOPIC_0000001188163786__b715092019211">shared_buffers</strong>.</li><li id="EN-US_TOPIC_0000001188163786__li97013521671">The maximum value is the value of <strong id="EN-US_TOPIC_0000001188163786__b38008312211">shared_buffers</strong>.</li></ul>
</div></div>
<p id="EN-US_TOPIC_0000001188163786__p64065158402"><strong id="EN-US_TOPIC_0000001188163786__b63675517620">Setting suggestions</strong>: If the cache hit ratio is not as expected during export, you are advised to configure this parameter on DNs.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s5575450815df4c1a94862e18ad8ae7c7"><h4 class="sectiontitle">temp_buffers</h4><p id="EN-US_TOPIC_0000001188163786__a449d096b8f994796b960dd40ca1b1517"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_en-us_topic_0058967553_b53579353">Parameter description</strong>: Specifies the maximum size of local temporary buffers used by each database session.</p>
<p id="EN-US_TOPIC_0000001188163786__p45971231011"><strong id="EN-US_TOPIC_0000001188163786__b174567419167">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__a842602bad84a49d69c64a7c3dd2e6e6a"><strong id="EN-US_TOPIC_0000001188163786__b395854245319">Value range</strong>: an integer ranging from 800 to INT_MAX/2. The unit is 8 KB.</p>
<p id="EN-US_TOPIC_0000001188163786__a9fe06563c6b9411dad3a2621fde4c46d"><strong id="EN-US_TOPIC_0000001188163786__b5735075_1">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b842352706103633">8 MB</strong></p>
<div class="note" id="EN-US_TOPIC_0000001188163786__note1137424211"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188163786__ul1182342010120"><li id="EN-US_TOPIC_0000001188163786__li1282310201110">This parameter can be modified only before the first use of temporary tables within each session. Subsequent attempts to change the value of this parameter will not take effect on that session.</li><li id="EN-US_TOPIC_0000001188163786__li98235203115">Based on the value of <strong id="EN-US_TOPIC_0000001188163786__b35988657114945">temp_buffers</strong>, a session allocates temporary buffers as required. The cost of setting a large value in sessions that do not require many temporary buffers is only a buffer descriptor. If a buffer is used, 8192 bytes will be consumed for it.</li></ul>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s7f44489cfdce4bbea287150fb7333b9e"><a name="EN-US_TOPIC_0000001188163786__s7f44489cfdce4bbea287150fb7333b9e"></a><a name="s7f44489cfdce4bbea287150fb7333b9e"></a><h4 class="sectiontitle">max_prepared_transactions</h4><p id="EN-US_TOPIC_0000001188163786__a416c3db7af684d91addee1d8eb9b8ceb"><strong id="EN-US_TOPIC_0000001188163786__b8992154612518">Parameter description</strong>: Specifies the maximum number of transactions that can stay in the <strong id="EN-US_TOPIC_0000001188163786__b169929467254">prepared</strong> state simultaneously. If this parameter is set to a large value, <span id="EN-US_TOPIC_0000001188163786__text121139121111">GaussDB(DWS)</span> may require more System V shared memory than the default setting.</p>
<p id="EN-US_TOPIC_0000001188163786__af5cf8c7797e044268c3038e645dd2466">When <span id="EN-US_TOPIC_0000001188163786__text1986969902">GaussDB(DWS)</span> is deployed as an HA system, set this parameter on the standby server to the same value or a value greater than that on the primary server. Otherwise, queries will fail on the standby server.</p>
<p id="EN-US_TOPIC_0000001188163786__p0299584111"><strong id="EN-US_TOPIC_0000001188163786__b241457161718">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001188163786__p175351852"><strong id="EN-US_TOPIC_0000001188163786__b19185214205412">Value range</strong>: an integer ranging from 0 to 536870911. The value of CN set to <strong id="EN-US_TOPIC_0000001188163786__b2742910546">0</strong> indicates that the prepared transaction feature is disabled.</p>
<p id="EN-US_TOPIC_0000001188163786__a90db78c7479647279334e481a5193044"><strong id="EN-US_TOPIC_0000001188163786__b446201819457">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b19468101844513">800</strong> for both CNs and DNs</p>
<div class="note" id="EN-US_TOPIC_0000001188163786__note139371481857"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188163786__a2770827fa8974c7aab9119dba173f832">Set this parameter to a value greater than or equal to that of <a href="dws_04_0889.html#EN-US_TOPIC_0000001188482316__s2d671f584b5647a19255e7c6a3d116aa">max_connections</a> to avoid failures in preparation.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s7be4202f202f4ccc8ecee5816cf7b2ab"><a name="EN-US_TOPIC_0000001188163786__s7be4202f202f4ccc8ecee5816cf7b2ab"></a><a name="s7be4202f202f4ccc8ecee5816cf7b2ab"></a><h4 class="sectiontitle">work_mem</h4><p id="EN-US_TOPIC_0000001188163786__a4d718eada595460dbda1aecb9224ee3e"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_en-us_topic_0058967553_b7672461">Parameter description</strong>: Specifies the memory capacity to be used by internal sort operations and Hash tables before writing to temporary disk files. Sort operations are used for <strong id="EN-US_TOPIC_0000001188163786__b8445072114945">ORDER BY</strong>, <strong id="EN-US_TOPIC_0000001188163786__b8896787114945">DISTINCT</strong>, and merge joins. Hash tables are required for Hash joins as well as Hash-based aggregations and <strong id="EN-US_TOPIC_0000001188163786__b84235270611117">IN</strong> subqueries.</p>
<p id="EN-US_TOPIC_0000001188163786__a8f4a2a083b5b4a7e8f23372ebf5f84ef">For a complex query, several sort or Hash operations may be running in parallel; each operation will be allowed to use as much memory as this value specifies. If the memory is insufficient, data is written into temporary files. In addition, several running sessions could be performing such operations concurrently. Therefore, the total memory used may be many times the value of <strong id="EN-US_TOPIC_0000001188163786__b12147121716918">work_mem</strong>.</p>
<p id="EN-US_TOPIC_0000001188163786__p98500231720"><strong id="EN-US_TOPIC_0000001188163786__b1218110816175">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__a1ef69f3a8b814f3da1623963166c0b77"><strong id="EN-US_TOPIC_0000001188163786__b107764471347">Value range</strong>: an integer ranging from 64 to INT_MAX. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001188163786__p17371152121914"><strong id="EN-US_TOPIC_0000001188163786__b14891134360">Default value</strong>: 512 MB for small-scale memory and 2 GB for large-scale memory (If <a href="#EN-US_TOPIC_0000001188163786__sadc1e0e8c1c246a4a6cad3967deebaad">max_process_memory</a> is greater than or equal to 30 GB, it is large-scale memory. Otherwise, it is small-scale memory.)</p>
<p id="EN-US_TOPIC_0000001188163786__aaaa800699caa4638b95c940fb426378d"><strong id="EN-US_TOPIC_0000001188163786__b15756926154512">Setting suggestions:</strong></p>
<p id="EN-US_TOPIC_0000001188163786__a836d7fac84df482aa98b9e2607c0b053">If the physical memory specified by <strong id="EN-US_TOPIC_0000001188163786__b19295151511579">work_mem</strong> is insufficient, additional operator calculation data will be written into temporary tables based on query characteristics and the degree of parallelism. This reduces performance by five to ten times, and prolongs the query response time from seconds to minutes.</p>
<ul id="EN-US_TOPIC_0000001188163786__u718a3b30e9e641ec9e79705dd08869ab"><li id="EN-US_TOPIC_0000001188163786__le7602efd88b14ba6a7fc576e15a101fb">In complex serial query scenarios, each query requires five to ten associated operations. Set <strong id="EN-US_TOPIC_0000001188163786__b842352706141733">work_mem</strong> using the following formula: <strong id="EN-US_TOPIC_0000001188163786__b842352706141729">work_mem</strong> = 50% of the memory/10.</li><li id="EN-US_TOPIC_0000001188163786__l9024241d7da24471be68210b22b69c7c">In simple serial query scenarios, each query requires two to five associated operations. Set <strong id="EN-US_TOPIC_0000001188163786__b84235270614180">work_mem</strong> using the following formula: <strong id="EN-US_TOPIC_0000001188163786__b84235270614188">work_mem</strong> = 50% of the memory/5.</li><li id="EN-US_TOPIC_0000001188163786__ldb55233f7e934d47adb0283d01e71959">For concurrent queries, use the formula: <strong id="EN-US_TOPIC_0000001188163786__b1028598712115851">work_mem</strong> = <strong id="EN-US_TOPIC_0000001188163786__b842352706105224">work_mem</strong> in serialized scenario/Number of concurrent SQL statements.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__sb55b56f971f54ebd88cbc13e2847f27b"><h4 class="sectiontitle">query_mem</h4><p id="EN-US_TOPIC_0000001188163786__a4b112a1fbc144edb9155d0ddbd752932"><strong id="EN-US_TOPIC_0000001188163786__b19501215194515">Parameter description</strong>: Specifies the memory used by query. If the value of <strong id="EN-US_TOPIC_0000001188163786__b1167549114619">query_mem</strong> is greater than 0, the optimizer adjusts the estimated query memory to this value when generating an execution plan.</p>
<p id="EN-US_TOPIC_0000001188163786__p1157613516315"><strong id="EN-US_TOPIC_0000001188163786__b2415179141710">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__a057b28fbc9b14c349fab7ac8ba598c3c"><strong id="EN-US_TOPIC_0000001188163786__b06066431474">Value range</strong>: <strong id="EN-US_TOPIC_0000001188163786__b19131756165411">0</strong> or an integer greater than 32 MB. The default unit is KB. If the value is set to a negative value or less than 32 MB, the default value <strong id="EN-US_TOPIC_0000001188163786__b1551105015482">0</strong> is used. In this case, the optimizer does not adjust the estimated query memory.</p>
<p id="EN-US_TOPIC_0000001188163786__aa19c1dc3a8f54f139171555d7b742fca"><strong id="EN-US_TOPIC_0000001188163786__b13915259151516">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b842352706165429">0</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__section1258420917117"><h4 class="sectiontitle">query_max_mem</h4><p id="EN-US_TOPIC_0000001188163786__p9584189617"><strong id="EN-US_TOPIC_0000001188163786__b13979115164917">Parameter description</strong>: Specifies the maximum memory that can be used by query. If the value of <strong id="EN-US_TOPIC_0000001188163786__b4436174203816">query_max_mem</strong> is greater than 0, when generating an execution plan, the optimizer uses this value to set the available memory for operators. If job memory usage exceeds the value of this parameter, an error is reported and the job exits.</p>
<p id="EN-US_TOPIC_0000001188163786__p6251841937"><strong id="EN-US_TOPIC_0000001188163786__b11813209111716">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__p45851891119"><strong id="EN-US_TOPIC_0000001188163786__b165291644135420">Value range</strong>: <strong id="EN-US_TOPIC_0000001188163786__b20674130122517">0</strong> or an integer greater than 32 MB. The default unit is KB. If the value is less than 32 MB, the system automatically sets this parameter to the default value <strong id="EN-US_TOPIC_0000001188163786__b26872373257">0</strong>. In this case, the optimizer does not limit the memory usage of jobs.</p>
<p id="EN-US_TOPIC_0000001188163786__p9585791715"><strong id="EN-US_TOPIC_0000001188163786__b2041886424">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b522207015">0</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__section1965895813510"><h4 class="sectiontitle">agg_max_mem</h4><p id="EN-US_TOPIC_0000001188163786__p1565835814353"><strong id="EN-US_TOPIC_0000001188163786__b13510114717221">Parameter description</strong>: Specifies the maximum memory that can be used by the Agg operator when the number of aggregation columns exceeds 5. This parameter takes effect only when the value of <strong id="EN-US_TOPIC_0000001188163786__b3218125302316">query_max_mem</strong> is greater than 0. (This parameter is supported only in 8.1.3.200 and later cluster versions.)</p>
<p id="EN-US_TOPIC_0000001188163786__p1665816581353"><strong id="EN-US_TOPIC_0000001188163786__b4723135132415">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__p16659558163513"><strong id="EN-US_TOPIC_0000001188163786__b1176699112418">Value range</strong>: <strong id="EN-US_TOPIC_0000001188163786__b1470051072513">0</strong> or an integer greater than 32 MB. The default unit is KB. If the value is less than 32 MB, the system automatically sets this parameter to the default value <strong id="EN-US_TOPIC_0000001188163786__b10129203382513">0</strong>. In this case, the memory usage of the Agg operator is not limited based on the value.</p>
<p id="EN-US_TOPIC_0000001188163786__p36591582352"><strong id="EN-US_TOPIC_0000001188163786__b1646131616244">Default value</strong>:</p>
<ul id="EN-US_TOPIC_0000001188163786__ul159063464418"><li id="EN-US_TOPIC_0000001188163786__li164061033184410">If the current cluster is upgraded from an earlier version to 8.1.3, the value in the earlier version is inherited. The default value is <strong id="EN-US_TOPIC_0000001188163786__b4588171811215">INT_MAX</strong>.</li><li id="EN-US_TOPIC_0000001188163786__li99071041448">If the current cluster version is 8.1.3, the default value is <strong id="EN-US_TOPIC_0000001188163786__b511853993910">2GB</strong>.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__sfbfa78b6871442cb85a84a425335ce38"><h4 class="sectiontitle">maintenance_work_mem</h4><p id="EN-US_TOPIC_0000001188163786__a6e4c75d261aa460c9dc1702edccc46a3"><strong id="EN-US_TOPIC_0000001188163786__b57829572">Parameter description:</strong> Specifies the maximum size of memory to be used for maintenance operations, such as <strong id="EN-US_TOPIC_0000001188163786__b815218171197">VACUUM</strong>, <strong id="EN-US_TOPIC_0000001188163786__b2152141719912">CREATE INDEX</strong>, and <strong id="EN-US_TOPIC_0000001188163786__b11524171598">ALTER TABLE ADD FOREIGN KEY</strong>. This parameter may affect the execution efficiency of VACUUM, VACUUM FULL, CLUSTER, and CREATE INDEX.</p>
<p id="EN-US_TOPIC_0000001188163786__p198401349730"><strong id="EN-US_TOPIC_0000001188163786__b1312719105171">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__a0db747d55ecf478e8b292ae6847d98c2"><strong id="EN-US_TOPIC_0000001188163786__b12218513515">Value range</strong>: an integer ranging from 1024 to INT_MAX. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001188163786__a824de0e080584392bf7772074d820696"><strong id="EN-US_TOPIC_0000001188163786__b132321817197">Default value</strong>: 512 MB for small-scale memory and 2 GB for large-scale memory (If <a href="#EN-US_TOPIC_0000001188163786__sadc1e0e8c1c246a4a6cad3967deebaad">max_process_memory</a> is greater than or equal to 30 GB, it is large-scale memory. Otherwise, it is small-scale memory.)</p>
<p id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_p153573115056"><strong id="EN-US_TOPIC_0000001188163786__b12323103712916">Setting suggestions:</strong></p>
<ul id="EN-US_TOPIC_0000001188163786__u51dee4cc6c024f2ca53da3c1b0862796"><li id="EN-US_TOPIC_0000001188163786__le0188fc2893044c3ab317cfb023e11ef">You are advised to set this parameter to the same value of <a href="#EN-US_TOPIC_0000001188163786__s7be4202f202f4ccc8ecee5816cf7b2ab">work_mem</a> so that database dump can be cleared or restored more quickly. In a database session, only one maintenance operation can be performed at a time. Maintenance is usually performed when there are not much sessions.</li><li id="EN-US_TOPIC_0000001188163786__la6d54b9a663a4514b6fb00f5cf8a12cd">When the <a href="dws_04_0923.html">Automatic Cleanup</a> process is running, up to <a href="dws_04_0923.html#EN-US_TOPIC_0000001188482222__s502d4304994d4da5bd3cda661aab27ac">autovacuum_max_workers</a> times of this memory may be allocated. Set <strong id="EN-US_TOPIC_0000001188163786__b2958042181115">maintenance_work_mem</strong> to a value equal to or larger than the value of <a href="#EN-US_TOPIC_0000001188163786__s7be4202f202f4ccc8ecee5816cf7b2ab">work_mem</a>.</li><li id="EN-US_TOPIC_0000001188163786__l1c61ac25f2224fd0b59452ef7ae9e16c">If a large amount of data needs to be processed in the cluster, increase the value of this parameter in sessions.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s1883c06368ec4e25809a0f9304de0838"><h4 class="sectiontitle">psort_work_mem</h4><p id="EN-US_TOPIC_0000001188163786__a52100b3f912446f8ac236c4ed86f1a11"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0085032388_b7672461">Parameter description</strong>: Specifies the memory used for internal sort operations on column-store tables before they are written into temporary disk files. This parameter can be used for inserting tables having a partial cluster key or index, creating a table index, and deleting or updating a table.</p>
<p id="EN-US_TOPIC_0000001188163786__p1630543411"><strong id="EN-US_TOPIC_0000001188163786__b116211510121713">Type</strong>: USERSET</p>
<div class="notice" id="EN-US_TOPIC_0000001188163786__n3fdae2587a704ce888343b2d12cdc8e2"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188163786__addc58e006d404987925cd30b86289710">Multiple running sessions may perform partial sorting on a table at the same time. Therefore, the total memory usage may be several times of the <strong id="EN-US_TOPIC_0000001188163786__b358934320306">psort_work_mem</strong> value.</p>
</div></div>
<p id="EN-US_TOPIC_0000001188163786__ab0348360693243e09ffc9cd036b27355"><strong id="EN-US_TOPIC_0000001188163786__b19148261440">Value range</strong>: an integer ranging from 64 to INT_MAX. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001188163786__a69debddb302e4b6d8242b719e76dca00"><strong id="EN-US_TOPIC_0000001188163786__b1812647444">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b842352706171333">512 MB</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s7d46a1bde1a54bb48be75dc350579bd0"><h4 class="sectiontitle">max_loaded_cudesc</h4><p id="EN-US_TOPIC_0000001188163786__a9b235e1ae61b4f7aa7e20d8837cc63b9"><strong id="EN-US_TOPIC_0000001188163786__b186084815814">Parameter description</strong>: Specifies the number of loaded CuDescs per column when a column-store table is scanned. Increasing the value will improve the query performance and increase the memory usage, particularly when there are many columns in the column tables.</p>
<p id="EN-US_TOPIC_0000001188163786__p740135651"><strong id="EN-US_TOPIC_0000001188163786__b12997536103214">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__acb664285ab5743c1860340dcf7c373e1"><strong id="EN-US_TOPIC_0000001188163786__b37827294415">Value range</strong>: an integer ranging from 100 to INT_MAX/2</p>
<p id="EN-US_TOPIC_0000001188163786__a58a1e3dbce7e479587bf33b354f55bd6"><strong id="EN-US_TOPIC_0000001188163786__b842352706174334">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b842352706174338">1024</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001188163786__n5fc2189631e548d48f63de246467a9a3"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188163786__a919870a0411048a5bd9759c92c885e6c">When the value of <strong id="EN-US_TOPIC_0000001188163786__b842352706201737">max_loaded_cudesc</strong> is set to a large value, the memory may be insufficient.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s58c856a5f8644e78ad18ca4907b3b2d8"><h4 class="sectiontitle">max_stack_depth</h4><p id="EN-US_TOPIC_0000001188163786__ab4a305c08b8b435986122f0a85796605"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0085032388_en-us_topic_0059777577_en-us_topic_0058967553_b27289114">Parameter description</strong>: Specifies the maximum safe depth of <span id="EN-US_TOPIC_0000001188163786__text1980935584">GaussDB(DWS)</span> execution stack. The safety margin is required because the stack depth is not checked in every routine in the server, but only in key potentially-recursive routines, such as expression evaluation.</p>
<p id="EN-US_TOPIC_0000001188163786__p861915016618"><strong id="EN-US_TOPIC_0000001188163786__b912515487412">Type</strong>: SUSET</p>
<p id="EN-US_TOPIC_0000001188163786__abca44778d3cd4181913b58920172ce3f"><strong id="EN-US_TOPIC_0000001188163786__b891151201613">Take the following into consideration when setting this parameter:</strong></p>
<ul id="EN-US_TOPIC_0000001188163786__u439ce43ee40347ab8f2e5972e6d4fcc6"><li id="EN-US_TOPIC_0000001188163786__lc375f2dd970042539bcc171b54e672f3">The ideal value of this parameter is the maximum stack size enforced by the kernel (value of <strong id="EN-US_TOPIC_0000001188163786__b1616111719912">ulimit -s</strong>).</li><li id="EN-US_TOPIC_0000001188163786__l7e1bb69b9ba2470394f61c4507752ed7">Setting this parameter to a value larger than the actual kernel limit means that a running recursive function may crash an individual backend process. In an OS where <span id="EN-US_TOPIC_0000001188163786__text788197789">GaussDB(DWS)</span> can check the kernel limit, such as the SLES, <span id="EN-US_TOPIC_0000001188163786__text116681230114919">GaussDB(DWS)</span> will prevent this parameter from being set to a value greater than the kernel limit.</li><li id="EN-US_TOPIC_0000001188163786__l5e062bca3fd84065978ea9b0a67db6a7">Since not all the OSs provide this function, you are advised to set a specific value for this parameter.</li></ul>
<p id="EN-US_TOPIC_0000001188163786__ac8f0835ddb0a454c88d58c20431ae293"><strong id="EN-US_TOPIC_0000001188163786__b836815341513">Value range</strong>: an integer ranging from 100 to INT_MAX. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001188163786__a0d6175ba0b4f40a58ffe233cddd8660d"><strong id="EN-US_TOPIC_0000001188163786__b18421943142113">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b7422943182119">2 MB</strong></p>
<div class="note" id="EN-US_TOPIC_0000001188163786__note96593318719"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188163786__p0659731077"><strong id="EN-US_TOPIC_0000001188163786__b1126319617255">2 MB</strong> is a small value and will not incur system breakdown in general, but may lead to execution failures of complex functions.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s709ee860890d4770b02842052b1d7dcf"><h4 class="sectiontitle">cstore_buffers</h4><p id="EN-US_TOPIC_0000001188163786__a89455377567f45b1ae13510f4a6cefc5"><strong id="EN-US_TOPIC_0000001188163786__b2836311141416">Parameter description</strong>: Specifies the size of the shared buffer used by ORC, Parquet, or CarbonData data of column-store tables and OBS or HDFS column-store foreign tables.</p>
<p id="EN-US_TOPIC_0000001188163786__p481083145411"><strong id="EN-US_TOPIC_0000001188163786__b3197394321">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001188163786__acee9171893fb4589ad3c309919a42b0f"><strong id="EN-US_TOPIC_0000001188163786__b1158016134519">Value range</strong>: an integer ranging from 16384 to INT_MAX. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001188163786__aa9861af468bc46218e2b1667450cf427"><strong id="EN-US_TOPIC_0000001188163786__b10737164271420">Default value</strong>: The CN size is 32 MB, and the DN size is calculated as follows: <strong id="EN-US_TOPIC_0000001188163786__b53251448102612">POWER(2,ROUND(LOG(2, max_process_memory/18),0))</strong>.</p>
<p id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_p198299011418"><strong id="EN-US_TOPIC_0000001188163786__b15601640181517">Setting suggestions:</strong></p>
<p id="EN-US_TOPIC_0000001188163786__a620a03efa1a140cfac656f13ff005f2a">Column-store tables use the shared buffer specified by <strong id="EN-US_TOPIC_0000001188163786__b842352706205810">cstore_buffers</strong> instead of that specified by <a href="#EN-US_TOPIC_0000001188163786__s9292cfbf38fa4b17b93e9a47330da753">shared_buffers</a>. When column-store tables are mainly used, reduce the value of <strong id="EN-US_TOPIC_0000001188163786__b84235270621050">shared_buffers</strong> and increase that of <strong id="EN-US_TOPIC_0000001188163786__b84235270621056">cstore_buffers</strong>.</p>
<p id="EN-US_TOPIC_0000001188163786__ad36fbbe2a5bf43489e48b3169266c440">Use <strong id="EN-US_TOPIC_0000001188163786__b1382112417174">cstore_buffers</strong> to specify the cache of ORC, Parquet, or CarbonData metadata and data for OBS or HDFS foreign tables. The metadata cache size should be 1/4 of <strong id="EN-US_TOPIC_0000001188163786__b1382742416173">cstore_buffers</strong> and not exceed 2 GB. The remaining cache is shared by column-store data and foreign table column-store data.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s48ff451293ab49f6a7380d8c6aff8d3b"><h4 class="sectiontitle">enable_orc_cache</h4><p id="EN-US_TOPIC_0000001188163786__a6c9a1e989ba94bceb0ddf8c0f237a90b"><strong id="EN-US_TOPIC_0000001188163786__b86457391183">Parameter description</strong>: Specifies whether to reserve 1/4 of <strong id="EN-US_TOPIC_0000001188163786__b15239125911817">cstore_buffers</strong> for storing ORC metadata when the cstore buffer is initialized.</p>
<p id="EN-US_TOPIC_0000001188163786__p173966271383"><strong id="EN-US_TOPIC_0000001188163786__b4418339163215">Type</strong>: POSTMASTER</p>
<p id="EN-US_TOPIC_0000001188163786__a8131d5ae0ed749528d186e2678e77b55"><strong id="EN-US_TOPIC_0000001188163786__b11726123801211">Value range</strong>: Boolean</p>
<p id="EN-US_TOPIC_0000001188163786__a02f2972aebc54c888c3dd8120a0d8ef8"><strong id="EN-US_TOPIC_0000001188163786__b5273740171210">Default value</strong>: </p>
<ul id="EN-US_TOPIC_0000001188163786__ua0eaec3fb8c54fca8e4795c9da05a5fb"><li id="EN-US_TOPIC_0000001188163786__ld06fa13499f04e53aad357e814c2e2b0"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0085032388_b84235270693717">on</strong> indicates that the orc metadata cache is enabled, which improves the query performance of the HDFS table but occupies the column-store buffer resources. The column-store performance deteriorates.</li><li id="EN-US_TOPIC_0000001188163786__l1f999f05110d4a37a7d84a389b43eb1b"><strong id="EN-US_TOPIC_0000001188163786__b84235270693636">off</strong> indicates the orc metadata cache is disabled.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__section176637461223"><h4 class="sectiontitle">schedule_splits_threshold</h4><p id="EN-US_TOPIC_0000001188163786__p76638469219"><strong id="EN-US_TOPIC_0000001188163786__b12176419145716">Parameter description</strong>: Specifies the maximum number of files that can be stored in memory when you schedule an HDFS foreign table. If the number is exceeded, all files in the list will be spilled to disk for scheduling.</p>
<p id="EN-US_TOPIC_0000001188163786__p111301028992"><strong id="EN-US_TOPIC_0000001188163786__b13931339163218">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__p2663846025"><strong id="EN-US_TOPIC_0000001188163786__b35751844115915">Value range</strong>: an integer ranging from 1 to INT_MAX</p>
<p id="EN-US_TOPIC_0000001188163786__p1574810101956"><strong id="EN-US_TOPIC_0000001188163786__b249719428573">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b167471247135719">60000</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__s276a71e500934b1b9cd238e4ef76cec9"><h4 class="sectiontitle">bulk_read_ring_size</h4><p id="EN-US_TOPIC_0000001188163786__a20dc08e0c6644c7e8745dfd921fbd43e"><strong id="EN-US_TOPIC_0000001188163786__en-us_topic_0059777577_a7e1dbd4a7c754824ba68c56399297af0">Parameter description</strong>: Specifies the ring buffer size used for data parallel export.</p>
<p id="EN-US_TOPIC_0000001188163786__p1518316391091"><strong id="EN-US_TOPIC_0000001188163786__b1141315406326">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__a33c109b8794f497e9dd150dd8492ac1b"><strong id="EN-US_TOPIC_0000001188163786__b451723717519">Value range</strong>: an integer ranging from 256 to INT_MAX. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001188163786__a7883899bf2c94378a7ffbbbe2512024a"><strong id="EN-US_TOPIC_0000001188163786__b26917141">Default value</strong>: <strong id="EN-US_TOPIC_0000001188163786__b842352706104513">16 MB</strong></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188163786__section16707110164714"><h4 class="sectiontitle">check_cu_size_threshold</h4><p id="EN-US_TOPIC_0000001188163786__p170714064718"><strong id="EN-US_TOPIC_0000001188163786__b97791523616">Parameter description</strong>: If the amount of data inserted to a CU is greater than the value of this parameter when data is inserted to a column-store table, the system starts row-level size verification to prevent the generation of a CU whose size is greater than 1 GB (non-compressed size).</p>
<p id="EN-US_TOPIC_0000001188163786__p1170714094711"><strong id="EN-US_TOPIC_0000001188163786__b1512795617159">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188163786__p1170718014711"><strong id="EN-US_TOPIC_0000001188163786__b2989134218134">Value range</strong>: an integer ranging from 0 to 1048576. The unit is KB.</p>
<p id="EN-US_TOPIC_0000001188163786__p1770716054714"><strong id="EN-US_TOPIC_0000001188163786__b1058360057101232">Default value:</strong> 1 GB</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0892.html">Resource Consumption</a></div>
</div>
</div>