gaussdb_umn

Reviewed-by: Wagner, Fabian <fabian.wagner@t-systems.com>
Co-authored-by: wangdengke2 <wangdengke2@huawei.com>
Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
This commit is contained in:
2025-10-06 06:53:07 +00:00
committed by zuul
parent 60127db659
commit 06c8ac5e62
20 changed files with 37 additions and 34 deletions

View File

@ -196,7 +196,7 @@
"node_id":"en-us_topic_0000002088677498.xml", "node_id":"en-us_topic_0000002088677498.xml",
"product_code":"opengauss", "product_code":"opengauss",
"code":"10", "code":"10",
"des":"Currently, GaussDB 8.103, 3.223, 3.222, 3.208, 3.103, 2.7, 2.3, 1.4, and 1.0 are supported.", "des":"Currently, GaussDB V2.0-8.102, V2.0-3.223, V2.0-3.222, and V2.0-3.208 are supported.",
"doc_type":"usermanual", "doc_type":"usermanual",
"kw":"Instance Versions,DB Instance Description,User Guide", "kw":"Instance Versions,DB Instance Description,User Guide",
"search_title":"", "search_title":"",
@ -3218,7 +3218,7 @@
"code":"154", "code":"154",
"des":"The nesting depth of multi-table association must be less than 8.If the association nesting is too deep, slow SQL statements may be generated. You need to optimize the as", "des":"The nesting depth of multi-table association must be less than 8.If the association nesting is too deep, slow SQL statements may be generated. You need to optimize the as",
"doc_type":"usermanual", "doc_type":"usermanual",
"kw":"Associated Query,Database Programming Guidelines,User Guide", "kw":"Join Query,Database Programming Guidelines,User Guide",
"search_title":"", "search_title":"",
"metedata":[ "metedata":[
{ {
@ -3229,7 +3229,7 @@
"IsBot":"Yes" "IsBot":"Yes"
} }
], ],
"title":"Associated Query", "title":"Join Query",
"githuburl":"" "githuburl":""
}, },
{ {
@ -3510,7 +3510,7 @@
"node_id":"en-us_topic_0000002088677158.xml", "node_id":"en-us_topic_0000002088677158.xml",
"product_code":"opengauss", "product_code":"opengauss",
"code":"168", "code":"168",
"des":"When workloads on a DB instance are heavy, the playback speed of standby nodes cannot catch up with write speed of primary nodes. After the system runs for a long time, l", "des":"When workloads on a DB instance are heavy, the replay speed of standby nodes cannot catch up with write speed of primary nodes. After the system runs for a long time, log",
"doc_type":"usermanual", "doc_type":"usermanual",
"kw":"What Do I Do If Replay Speed of Standby Nodes Cannot Catch Up with Write Speed of Primary Nodes?,FAQ", "kw":"What Do I Do If Replay Speed of Standby Nodes Cannot Catch Up with Write Speed of Primary Nodes?,FAQ",
"search_title":"", "search_title":"",

View File

@ -81,7 +81,7 @@
"code":"9" "code":"9"
}, },
{ {
"desc":"Currently, GaussDB 8.103, 3.223, 3.222, 3.208, 3.103, 2.7, 2.3, 1.4, and 1.0 are supported.", "desc":"Currently, GaussDB V2.0-8.102, V2.0-3.223, V2.0-3.222, and V2.0-3.208 are supported.",
"product_code":"opengauss", "product_code":"opengauss",
"title":"Instance Versions", "title":"Instance Versions",
"uri":"opengauss_01_0008.html", "uri":"opengauss_01_0008.html",
@ -1379,7 +1379,7 @@
{ {
"desc":"The nesting depth of multi-table association must be less than 8.If the association nesting is too deep, slow SQL statements may be generated. You need to optimize the as", "desc":"The nesting depth of multi-table association must be less than 8.If the association nesting is too deep, slow SQL statements may be generated. You need to optimize the as",
"product_code":"opengauss", "product_code":"opengauss",
"title":"Associated Query", "title":"Join Query",
"uri":"opengauss_tips_0022.html", "uri":"opengauss_tips_0022.html",
"doc_type":"usermanual", "doc_type":"usermanual",
"p_code":"146", "p_code":"146",
@ -1503,7 +1503,7 @@
"code":"167" "code":"167"
}, },
{ {
"desc":"When workloads on a DB instance are heavy, the playback speed of standby nodes cannot catch up with write speed of primary nodes. After the system runs for a long time, l", "desc":"When workloads on a DB instance are heavy, the replay speed of standby nodes cannot catch up with write speed of primary nodes. After the system runs for a long time, log",
"product_code":"opengauss", "product_code":"opengauss",
"title":"What Do I Do If Replay Speed of Standby Nodes Cannot Catch Up with Write Speed of Primary Nodes?", "title":"What Do I Do If Replay Speed of Standby Nodes Cannot Catch Up with Write Speed of Primary Nodes?",
"uri":"opengauss_faq_0010.html", "uri":"opengauss_faq_0010.html",

View File

@ -3,7 +3,7 @@
<h1 class="topictitle1">Basic Concepts</h1> <h1 class="topictitle1">Basic Concepts</h1>
<div id="body1603702783071"><div class="section" id="EN-US_TOPIC_0000002124277413__section1319213812395"><h4 class="sectiontitle">Instances</h4><p id="EN-US_TOPIC_0000002124277413__a7472f2a2bb3643c39f5de90e0bcd5aa2">The smallest management unit in <span id="EN-US_TOPIC_0000002124277413__text19653144416">GaussDB</span> is the instance. A DB instance is an isolated database environment hosted in the cloud. You can create and manage <span id="EN-US_TOPIC_0000002124277413__text916483544417">GaussDB</span> instances on the management console. For details about instance statuses, instance specifications, storage types, and versions, see <a href="opengauss_01_0005.html">DB Instance Description</a>.</p> <div id="body1603702783071"><div class="section" id="EN-US_TOPIC_0000002124277413__section1319213812395"><h4 class="sectiontitle">Instances</h4><p id="EN-US_TOPIC_0000002124277413__a7472f2a2bb3643c39f5de90e0bcd5aa2">The smallest management unit in <span id="EN-US_TOPIC_0000002124277413__text19653144416">GaussDB</span> is the instance. A DB instance is an isolated database environment hosted in the cloud. You can create and manage <span id="EN-US_TOPIC_0000002124277413__text916483544417">GaussDB</span> instances on the management console. For details about instance statuses, instance specifications, storage types, and versions, see <a href="opengauss_01_0005.html">DB Instance Description</a>.</p>
</div> </div>
<div class="section" id="EN-US_TOPIC_0000002124277413__section79302616515"><h4 class="sectiontitle">Instance Versions</h4><p id="EN-US_TOPIC_0000002124277413__p1342581115810">Currently, <span id="EN-US_TOPIC_0000002124277413__en-us_topic_0000002088677498_text795354316501">GaussDB</span> 8.103, 3.223, 3.222, 3.208, 3.103, 2.7, 2.3, 1.4, and 1.0 are supported.</p> <div class="section" id="EN-US_TOPIC_0000002124277413__section79302616515"><h4 class="sectiontitle">Instance Versions</h4><p id="EN-US_TOPIC_0000002124277413__p1342581115810">Currently, <span id="EN-US_TOPIC_0000002124277413__en-us_topic_0000002088677498_text795354316501">GaussDB</span> V2.0-8.102, V2.0-3.223, V2.0-3.222, and V2.0-3.208 are supported.</p>
</div> </div>
<div class="section" id="EN-US_TOPIC_0000002124277413__section4661194916550"><h4 class="sectiontitle">Instance Types</h4><p id="EN-US_TOPIC_0000002124277413__p27439525569"><span id="EN-US_TOPIC_0000002124277413__text027640185713">GaussDB</span> supports <span id="EN-US_TOPIC_0000002124277413__text11128913142311">distributed</span> instances. Distributed instances allow you to add nodes as needed to handle large volumes of concurrent requests. The <span id="EN-US_TOPIC_0000002124277413__text101720325235">primary/standby</span> instances are suitable for scenarios with small and stable volumes of data, where data reliability and service availability are important.</p> <div class="section" id="EN-US_TOPIC_0000002124277413__section4661194916550"><h4 class="sectiontitle">Instance Types</h4><p id="EN-US_TOPIC_0000002124277413__p27439525569"><span id="EN-US_TOPIC_0000002124277413__text027640185713">GaussDB</span> supports <span id="EN-US_TOPIC_0000002124277413__text11128913142311">distributed</span> instances. Distributed instances allow you to add nodes as needed to handle large volumes of concurrent requests. The <span id="EN-US_TOPIC_0000002124277413__text101720325235">primary/standby</span> instances are suitable for scenarios with small and stable volumes of data, where data reliability and service availability are important.</p>
</div> </div>

View File

@ -1,7 +1,7 @@
<a name="EN-US_TOPIC_0000002088677498"></a><a name="EN-US_TOPIC_0000002088677498"></a> <a name="EN-US_TOPIC_0000002088677498"></a><a name="EN-US_TOPIC_0000002088677498"></a>
<h1 class="topictitle1">Instance Versions</h1> <h1 class="topictitle1">Instance Versions</h1>
<div id="body1603781282151"><p id="EN-US_TOPIC_0000002088677498__p495313438506">Currently, <span id="EN-US_TOPIC_0000002088677498__text795354316501">GaussDB</span> 8.103, 3.223, 3.222, 3.208, 3.103, 2.7, 2.3, 1.4, and 1.0 are supported.</p> <div id="body1603781282151"><p id="EN-US_TOPIC_0000002088677498__p495313438506">Currently, <span id="EN-US_TOPIC_0000002088677498__text795354316501">GaussDB</span> V2.0-8.102, V2.0-3.223, V2.0-3.222, and V2.0-3.208 are supported.</p>
</div> </div>
<div> <div>
<div class="familylinks"> <div class="familylinks">

View File

@ -32,7 +32,7 @@
</tr> </tr>
<tr id="EN-US_TOPIC_0000002088677754__en-us_topic_0207350132_en-us_topic_0204832111_row667672017449"><td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.5.2.3.2.3.1.1 "><p id="EN-US_TOPIC_0000002088677754__en-us_topic_0207350132_en-us_topic_0204832111_p10676102074415">DB Engine Version</p> <tr id="EN-US_TOPIC_0000002088677754__en-us_topic_0207350132_en-us_topic_0204832111_row667672017449"><td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.5.2.3.2.3.1.1 "><p id="EN-US_TOPIC_0000002088677754__en-us_topic_0207350132_en-us_topic_0204832111_p10676102074415">DB Engine Version</p>
</td> </td>
<td class="cellrowborder" valign="top" width="76%" headers="mcps1.3.2.2.5.2.3.2.3.1.2 "><p id="EN-US_TOPIC_0000002088677754__p42214224573">Currently, <span id="EN-US_TOPIC_0000002088677754__en-us_topic_0000002088677498_text795354316501">GaussDB</span> 8.103, 3.223, 3.222, 3.208, 3.103, 2.7, 2.3, 1.4, and 1.0 are supported.</p> <td class="cellrowborder" valign="top" width="76%" headers="mcps1.3.2.2.5.2.3.2.3.1.2 "><p id="EN-US_TOPIC_0000002088677754__p42214224573">Currently, <span id="EN-US_TOPIC_0000002088677754__en-us_topic_0000002088677498_text795354316501">GaussDB</span> V2.0-8.102, V2.0-3.223, V2.0-3.222, and V2.0-3.208 are supported.</p>
</td> </td>
</tr> </tr>
<tr id="EN-US_TOPIC_0000002088677754__en-us_topic_0207350132_en-us_topic_0204832111_row17676220104418"><td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.5.2.3.2.3.1.1 "><p id="EN-US_TOPIC_0000002088677754__en-us_topic_0207350132_en-us_topic_0204832111_p13676192011449">DB Instance Type</p> <tr id="EN-US_TOPIC_0000002088677754__en-us_topic_0207350132_en-us_topic_0204832111_row17676220104418"><td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.2.2.5.2.3.2.3.1.1 "><p id="EN-US_TOPIC_0000002088677754__en-us_topic_0207350132_en-us_topic_0204832111_p13676192011449">DB Instance Type</p>

View File

@ -4,7 +4,7 @@
<div id="body1588227561221"><div class="section" id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_section3037032812838"><h4 class="sectiontitle">Scenarios</h4><p id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_p2898859142259">You can use an instance-level automated backup to restore a <span id="EN-US_TOPIC_0000002088517758__text1880017111411">GaussDB</span> instance to a specified point in time.</p> <div id="body1588227561221"><div class="section" id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_section3037032812838"><h4 class="sectiontitle">Scenarios</h4><p id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_p2898859142259">You can use an instance-level automated backup to restore a <span id="EN-US_TOPIC_0000002088517758__text1880017111411">GaussDB</span> instance to a specified point in time.</p>
<p id="EN-US_TOPIC_0000002088517758__p085611161915">You can restore data to a new instance.</p> <p id="EN-US_TOPIC_0000002088517758__p085611161915">You can restore data to a new instance.</p>
</div> </div>
<div class="section" id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_section18971149163412"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_ul662316293510"><li id="EN-US_TOPIC_0000002088517758__li022725214542">Only instances of version 2.1 or later can be restored to any point in time.</li><li id="EN-US_TOPIC_0000002088517758__li4145245175811">If nodes are being added, versions are being upgraded, or data is being restored to an existing instance, the instance cannot be restored a specific point in time.</li><li id="EN-US_TOPIC_0000002088517758__li55365131558">If a DB instance is faulty or a CN is removed, archive logs cannot be generated and the instance cannot be restored to a specific point in time.</li><li id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_li626555016383">If you restore backup data to a new DB instance:<ul id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_ul11797219395"><li id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_li67971817398">The DB engine and major version are the same as those of the original DB instance and cannot be changed.</li><li id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_li77971716394">The administrator password needs to be reset.</li></ul> <div class="section" id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_section18971149163412"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_ul662316293510"><li id="EN-US_TOPIC_0000002088517758__li022725214542">Only instances of version 2.1 or later can be restored to any point in time.</li><li id="EN-US_TOPIC_0000002088517758__li4145245175811">Data from the time period of the following operations cannot be restored: nodes are being added to an instance, the instance version is being upgraded, or the instance data is being restored.</li><li id="EN-US_TOPIC_0000002088517758__li55365131558">If a DB instance is faulty or a CN is removed, archive logs cannot be generated, and data from the affected time period cannot be restored.</li><li id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_li626555016383">If you restore backup data to a new DB instance:<ul id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_ul11797219395"><li id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_li67971817398">The DB engine and major version are the same as those of the original DB instance and cannot be changed.</li><li id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_en-us_topic_0192953929_li77971716394">The administrator password needs to be reset.</li></ul>
</li><li id="EN-US_TOPIC_0000002088517758__li1748314401128">If you restore backup data to the original DB instance, data on the original instance will be overwritten and the original DB instance will be unavailable during the restoration. Additionally, log archiving stops. After the restoration is complete, the <strong id="EN-US_TOPIC_0000002088517758__b459812861512">Confirm Data Integrity</strong> button is displayed. Before clicking <strong id="EN-US_TOPIC_0000002088517758__b1272617473152">Confirm Data Integrity</strong>, you can restore data for multiple times. Once data integrity has been confirmed, any logs archived after the point in time data was restored from will be lost, but normal log archiving will be restored.</li><li id="EN-US_TOPIC_0000002088517758__li3204175942419">When a DB instance is deleted, all archive logs are deleted by default and cannot be retained. Data cannot be restored to a specific point in time after the DB instance is rebuilt.</li></ul> </li><li id="EN-US_TOPIC_0000002088517758__li1748314401128">If you restore backup data to the original DB instance, data on the original instance will be overwritten and the original DB instance will be unavailable during the restoration. Additionally, log archiving stops. After the restoration is complete, the <strong id="EN-US_TOPIC_0000002088517758__b459812861512">Confirm Data Integrity</strong> button is displayed. Before clicking <strong id="EN-US_TOPIC_0000002088517758__b1272617473152">Confirm Data Integrity</strong>, you can restore data for multiple times. Once data integrity has been confirmed, any logs archived after the point in time data was restored from will be lost, but normal log archiving will be restored.</li><li id="EN-US_TOPIC_0000002088517758__li3204175942419">When a DB instance is deleted, all archive logs are deleted by default and cannot be retained. Data cannot be restored to a specific point in time after the DB instance is rebuilt.</li></ul>
</div> </div>
<div class="section" id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_section92821456184113"><h4 class="sectiontitle"><strong id="EN-US_TOPIC_0000002088517758__b11872043111311">Procedure</strong></h4><ol id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_oacb9a8ec019b4a69a57bc49bd0c88922"><li id="EN-US_TOPIC_0000002088517758__li1717453954820"><span>Log in to the management console.</span></li><li id="EN-US_TOPIC_0000002088517758__en-us_topic_0207350132_en-us_topic_0204832111_l541898ae0beb476b8d4ba4e68723bbe9"><span>Click <span><img id="EN-US_TOPIC_0000002088517758__image1890894455240" src="figure/en-us_image_0000002088517922.png"></span> in the upper left corner and select a region and project.</span><p><p id="EN-US_TOPIC_0000002088517758__en-us_topic_0000001617547598_p1947616374"></p> <div class="section" id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_section92821456184113"><h4 class="sectiontitle"><strong id="EN-US_TOPIC_0000002088517758__b11872043111311">Procedure</strong></h4><ol id="EN-US_TOPIC_0000002088517758__en-us_topic_0204854000_oacb9a8ec019b4a69a57bc49bd0c88922"><li id="EN-US_TOPIC_0000002088517758__li1717453954820"><span>Log in to the management console.</span></li><li id="EN-US_TOPIC_0000002088517758__en-us_topic_0207350132_en-us_topic_0204832111_l541898ae0beb476b8d4ba4e68723bbe9"><span>Click <span><img id="EN-US_TOPIC_0000002088517758__image1890894455240" src="figure/en-us_image_0000002088517922.png"></span> in the upper left corner and select a region and project.</span><p><p id="EN-US_TOPIC_0000002088517758__en-us_topic_0000001617547598_p1947616374"></p>

View File

@ -606,7 +606,7 @@
</td> </td>
<td class="cellrowborder" valign="top" width="16.67777037530535%" headers="mcps1.3.3.3.2.7.1.2 "><p id="EN-US_TOPIC_0000002124277461__p4199164101217">Online Sessions</p> <td class="cellrowborder" valign="top" width="16.67777037530535%" headers="mcps1.3.3.3.2.7.1.2 "><p id="EN-US_TOPIC_0000002124277461__p4199164101217">Online Sessions</p>
</td> </td>
<td class="cellrowborder" valign="top" width="28.414390406395736%" headers="mcps1.3.3.3.2.7.1.3 "><p id="EN-US_TOPIC_0000002124277461__p6517124810125">Number of real-time online sessions</p> <td class="cellrowborder" valign="top" width="28.414390406395736%" headers="mcps1.3.3.3.2.7.1.3 "><p id="EN-US_TOPIC_0000002124277461__p6517124810125">Real-time number of online sessions</p>
</td> </td>
<td class="cellrowborder" valign="top" width="11.74772373972907%" headers="mcps1.3.3.3.2.7.1.4 "><p id="EN-US_TOPIC_0000002124277461__p35664477">Distributed: all CNs + primary DN</p> <td class="cellrowborder" valign="top" width="11.74772373972907%" headers="mcps1.3.3.3.2.7.1.4 "><p id="EN-US_TOPIC_0000002124277461__p35664477">Distributed: all CNs + primary DN</p>
<p id="EN-US_TOPIC_0000002124277461__p25186204714">Centralized: all DNs</p> <p id="EN-US_TOPIC_0000002124277461__p25186204714">Centralized: all DNs</p>

View File

@ -1,7 +1,7 @@
<a name="EN-US_TOPIC_0000002088677158"></a><a name="EN-US_TOPIC_0000002088677158"></a> <a name="EN-US_TOPIC_0000002088677158"></a><a name="EN-US_TOPIC_0000002088677158"></a>
<h1 class="topictitle1">What Do I Do If Replay Speed of Standby Nodes Cannot Catch Up with Write Speed of Primary Nodes?</h1> <h1 class="topictitle1">What Do I Do If Replay Speed of Standby Nodes Cannot Catch Up with Write Speed of Primary Nodes?</h1>
<div id="body0000001272360586"><div class="section" id="EN-US_TOPIC_0000002088677158__section125451614163415"><h4 class="sectiontitle">Symptom</h4><p id="EN-US_TOPIC_0000002088677158__p3749617143413">When workloads on a DB instance are heavy, the playback speed of standby nodes cannot catch up with write speed of primary nodes. After the system runs for a long time, logs are accumulated on the standby nodes. If a primary node is faulty, data restoration takes a long time and the database is unavailable, severely affecting system availability.</p> <div id="body0000001272360586"><div class="section" id="EN-US_TOPIC_0000002088677158__section125451614163415"><h4 class="sectiontitle">Symptom</h4><p id="EN-US_TOPIC_0000002088677158__p3749617143413">When workloads on a DB instance are heavy, the replay speed of standby nodes cannot catch up with write speed of primary nodes. After the system runs for a long time, logs are accumulated on the standby nodes. If a primary node is faulty, data restoration takes a long time and the database is unavailable, severely affecting system availability.</p>
</div> </div>
<div class="section" id="EN-US_TOPIC_0000002088677158__section31621724153413"><h4 class="sectiontitle">Solution</h4><p id="EN-US_TOPIC_0000002088677158__p103421137174218"><span id="EN-US_TOPIC_0000002088677158__text14342123784216">GaussDB</span> provides ultimate RTO to minimize the data recovery time after a primary node is faulty and improve availability.</p> <div class="section" id="EN-US_TOPIC_0000002088677158__section31621724153413"><h4 class="sectiontitle">Solution</h4><p id="EN-US_TOPIC_0000002088677158__p103421137174218"><span id="EN-US_TOPIC_0000002088677158__text14342123784216">GaussDB</span> provides ultimate RTO to minimize the data recovery time after a primary node is faulty and improve availability.</p>
<p id="EN-US_TOPIC_0000002088677158__p720426163514">To use ultimate RTO, submit an application by choosing in the upper right corner of the console.</p> <p id="EN-US_TOPIC_0000002088677158__p720426163514">To use ultimate RTO, submit an application by choosing in the upper right corner of the console.</p>

View File

@ -12,7 +12,7 @@
</div> </div>
<div class="section" id="EN-US_TOPIC_0000002088517706__section14962mcpsimp"><h4 class="sectiontitle">Execution Plan Information</h4><p id="EN-US_TOPIC_0000002088517706__p14964mcpsimp">In addition to configuring different display formats for execution plans, you can use different <strong id="EN-US_TOPIC_0000002088517706__b1185101439112930">EXPLAIN</strong> syntax to display execution plan information in detail. </p> <div class="section" id="EN-US_TOPIC_0000002088517706__section14962mcpsimp"><h4 class="sectiontitle">Execution Plan Information</h4><p id="EN-US_TOPIC_0000002088517706__p14964mcpsimp">In addition to configuring different display formats for execution plans, you can use different <strong id="EN-US_TOPIC_0000002088517706__b1185101439112930">EXPLAIN</strong> syntax to display execution plan information in detail. </p>
<ul id="EN-US_TOPIC_0000002088517706__ul14967mcpsimp"><li id="EN-US_TOPIC_0000002088517706__li14968mcpsimp">EXPLAIN <em id="EN-US_TOPIC_0000002088517706__i14969mcpsimp">statement</em>: only generates an execution plan and does not execute. The <em id="EN-US_TOPIC_0000002088517706__i842352697164752">statement</em> indicates SQL statements.</li><li id="EN-US_TOPIC_0000002088517706__li14970mcpsimp">EXPLAIN ANALYZE <em id="EN-US_TOPIC_0000002088517706__i14971mcpsimp">statement</em>: generates and executes an execution plan, and displays the execution summary. Then actual execution time statistics are added, including the total elapsed time expended within each plan node (in milliseconds) and the total number of rows it actually returned.</li><li id="EN-US_TOPIC_0000002088517706__li14972mcpsimp">EXPLAIN PERFORMANCE <em id="EN-US_TOPIC_0000002088517706__i14973mcpsimp">statement</em>: generates and executes an execution plan, and displays all execution information.</li></ul> <ul id="EN-US_TOPIC_0000002088517706__ul14967mcpsimp"><li id="EN-US_TOPIC_0000002088517706__li14968mcpsimp">EXPLAIN <em id="EN-US_TOPIC_0000002088517706__i14969mcpsimp">statement</em>: only generates an execution plan and does not execute. The <em id="EN-US_TOPIC_0000002088517706__i842352697164752">statement</em> indicates SQL statements.</li><li id="EN-US_TOPIC_0000002088517706__li14970mcpsimp">EXPLAIN ANALYZE <em id="EN-US_TOPIC_0000002088517706__i14971mcpsimp">statement</em>: generates and executes an execution plan, and displays the execution summary. Then actual execution time statistics are added, including the total elapsed time expended within each plan node (in milliseconds) and the total number of rows it actually returned.</li><li id="EN-US_TOPIC_0000002088517706__li14972mcpsimp">EXPLAIN PERFORMANCE <em id="EN-US_TOPIC_0000002088517706__i14973mcpsimp">statement</em>: generates and executes an execution plan, and displays all execution information.</li></ul>
<p id="EN-US_TOPIC_0000002088517706__p14974mcpsimp">To measure the run time cost of each node in the execution plan, the current execution of <strong id="EN-US_TOPIC_0000002088517706__b1599471915112930">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000002088517706__b1332928123112930">EXPLAIN PERFORMANCE</strong> adds profiling overhead to query execution. Running <strong id="EN-US_TOPIC_0000002088517706__b2080892317173155">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000002088517706__b1900799391173155">PERFORMANCE</strong> on a query sometimes takes longer time than executing the query normally. The amount of overhead depends on the nature of the query, as well as the platform being used. For details, see "SQL Reference" &gt; "SQL Syntax" &gt; "EXPLAIN" in <em id="EN-US_TOPIC_0000002088517706__i13871637288">GaussDB Development Guide (1.x)</em>.</p> <p id="EN-US_TOPIC_0000002088517706__p14974mcpsimp">To measure the run time cost of each node in the execution plan, the current execution of <strong id="EN-US_TOPIC_0000002088517706__b1599471915112930">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000002088517706__b1332928123112930">EXPLAIN PERFORMANCE</strong> adds profiling overhead to query execution. Running <strong id="EN-US_TOPIC_0000002088517706__b2080892317173155">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000002088517706__b1900799391173155">PERFORMANCE</strong> on a query sometimes takes longer time than executing the query normally. The amount of overhead depends on the nature of the query, as well as the platform being used. For details, see "SQL Reference" &gt; "SQL Syntax" &gt; "EXPLAIN" in <em id="EN-US_TOPIC_0000002088517706__i13871637288">GaussDB Developer Guide (1.x)</em>.</p>
<p id="EN-US_TOPIC_0000002088517706__p14975mcpsimp">Therefore, if a SQL statement is not finished after being running for a long time, run the <strong id="EN-US_TOPIC_0000002088517706__b1850153125820">EXPLAIN</strong> statement to view the execution plan and then locate the fault. If the SQL statement has been properly executed, run the <strong id="EN-US_TOPIC_0000002088517706__b1467171370112930">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000002088517706__b1338292865112930">EXPLAIN PERFORMANCE</strong> statement to check the execution plan and information to locate the fault.</p> <p id="EN-US_TOPIC_0000002088517706__p14975mcpsimp">Therefore, if a SQL statement is not finished after being running for a long time, run the <strong id="EN-US_TOPIC_0000002088517706__b1850153125820">EXPLAIN</strong> statement to view the execution plan and then locate the fault. If the SQL statement has been properly executed, run the <strong id="EN-US_TOPIC_0000002088517706__b1467171370112930">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000002088517706__b1338292865112930">EXPLAIN PERFORMANCE</strong> statement to check the execution plan and information to locate the fault.</p>
<p id="EN-US_TOPIC_0000002088517706__p14976mcpsimp">The <strong id="EN-US_TOPIC_0000002088517706__b1748818272112930">EXPLAIN PERFORMANCE</strong> lightweight execution is consistent with <strong id="EN-US_TOPIC_0000002088517706__b1717142157112930">EXPLAIN PERFORMANCE</strong> but greatly reduces the time spent on performance analysis.</p> <p id="EN-US_TOPIC_0000002088517706__p14976mcpsimp">The <strong id="EN-US_TOPIC_0000002088517706__b1748818272112930">EXPLAIN PERFORMANCE</strong> lightweight execution is consistent with <strong id="EN-US_TOPIC_0000002088517706__b1717142157112930">EXPLAIN PERFORMANCE</strong> but greatly reduces the time spent on performance analysis.</p>
</div> </div>

View File

@ -81,7 +81,7 @@ FROM store_sales;</pre>
<p class="msonormal" id="EN-US_TOPIC_0000002124277309__p15428mcpsimp"><span><img id="EN-US_TOPIC_0000002124277309__image403" src="figure/en-us_image_0000002124197337.png" height="39.900000000000006" width="522.69" title="Click to enlarge" class="imgResize"></span></p> <p class="msonormal" id="EN-US_TOPIC_0000002124277309__p15428mcpsimp"><span><img id="EN-US_TOPIC_0000002124277309__image403" src="figure/en-us_image_0000002124197337.png" height="39.900000000000006" width="522.69" title="Click to enlarge" class="imgResize"></span></p>
<p id="EN-US_TOPIC_0000002124277309__p15429mcpsimp"><strong id="EN-US_TOPIC_0000002124277309__b109876167527">func_percent_1</strong> is pushed down to DNs for quicker execution. (In TPC-DS 1000X, where three CNs and 18 DNs are used, the query efficiency is improved by over 100 times).</p> <p id="EN-US_TOPIC_0000002124277309__p15429mcpsimp"><strong id="EN-US_TOPIC_0000002124277309__b109876167527">func_percent_1</strong> is pushed down to DNs for quicker execution. (In TPC-DS 1000X, where three CNs and 18 DNs are used, the query efficiency is improved by over 100 times).</p>
</div> </div>
<div class="section" id="EN-US_TOPIC_0000002124277309__section15430mcpsimp"><a name="EN-US_TOPIC_0000002124277309__section15430mcpsimp"></a><a name="section15430mcpsimp"></a><h4 class="sectiontitle">Functions That Do Not Support Pushdown</h4><p id="EN-US_TOPIC_0000002124277309__p15431mcpsimp">The following describes the volatility of functions. The function variability in <span id="EN-US_TOPIC_0000002124277309__text15457410124113">GaussDB</span> is as follows:</p> <div class="section" id="EN-US_TOPIC_0000002124277309__section15430mcpsimp"><a name="EN-US_TOPIC_0000002124277309__section15430mcpsimp"></a><a name="section15430mcpsimp"></a><h4 class="sectiontitle">Functions That Do Not Support Pushdown</h4><p id="EN-US_TOPIC_0000002124277309__p15431mcpsimp">The following describes the volatility of functions. The function volatility in <span id="EN-US_TOPIC_0000002124277309__text15457410124113">GaussDB</span> is as follows:</p>
<ul id="EN-US_TOPIC_0000002124277309__ul15432mcpsimp"><li id="EN-US_TOPIC_0000002124277309__li15433mcpsimp"><strong id="EN-US_TOPIC_0000002124277309__b15434mcpsimp">IMMUTABLE</strong><p id="EN-US_TOPIC_0000002124277309__p15435mcpsimp">Specifies that the function always returns the same result if the parameter values are the same.</p> <ul id="EN-US_TOPIC_0000002124277309__ul15432mcpsimp"><li id="EN-US_TOPIC_0000002124277309__li15433mcpsimp"><strong id="EN-US_TOPIC_0000002124277309__b15434mcpsimp">IMMUTABLE</strong><p id="EN-US_TOPIC_0000002124277309__p15435mcpsimp">Specifies that the function always returns the same result if the parameter values are the same.</p>
</li><li id="EN-US_TOPIC_0000002124277309__li15436mcpsimp"><strong id="EN-US_TOPIC_0000002124277309__b15437mcpsimp">STABLE</strong><p id="EN-US_TOPIC_0000002124277309__p15438mcpsimp">Specifies that the function cannot modify the database, and that within a single table scan, it will consistently return the same result for the same parameter value, but its result varies by SQL statements.</p> </li><li id="EN-US_TOPIC_0000002124277309__li15436mcpsimp"><strong id="EN-US_TOPIC_0000002124277309__b15437mcpsimp">STABLE</strong><p id="EN-US_TOPIC_0000002124277309__p15438mcpsimp">Specifies that the function cannot modify the database, and that within a single table scan, it will consistently return the same result for the same parameter value, but its result varies by SQL statements.</p>
</li><li id="EN-US_TOPIC_0000002124277309__li15439mcpsimp"><strong id="EN-US_TOPIC_0000002124277309__b15440mcpsimp">VOLATILE</strong><p id="EN-US_TOPIC_0000002124277309__p15441mcpsimp">Specifies that the function value can change in a single table scan and no optimization is performed.</p> </li><li id="EN-US_TOPIC_0000002124277309__li15439mcpsimp"><strong id="EN-US_TOPIC_0000002124277309__b15440mcpsimp">VOLATILE</strong><p id="EN-US_TOPIC_0000002124277309__p15441mcpsimp">Specifies that the function value can change in a single table scan and no optimization is performed.</p>
@ -136,7 +136,7 @@ postgres=# CREATE TABLE sal_emp ( c1 integer[] ) DISTRIBUTE BY replication;</pre
<span class="normal"> 8</span> <span class="normal"> 8</span>
<span class="normal"> 9</span> <span class="normal"> 9</span>
<span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">postgres</span><span class="o">=#</span><span class="w"> </span><span class="k">explain</span><span class="w"> </span><span class="k">verbose</span><span class="w"> </span><span class="k">select</span><span class="w"> </span><span class="k">count</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="n">c_custkey</span><span class="w"> </span><span class="k">order</span><span class="w"> </span><span class="k">by</span><span class="w"> </span><span class="n">c_custkey</span><span class="p">)</span><span class="w"> </span><span class="k">from</span><span class="w"> </span><span class="n">customer1</span><span class="p">;</span> <span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">postgres</span><span class="o">=#</span><span class="w"> </span><span class="k">explain</span><span class="w"> </span><span class="k">verbose</span><span class="w"> </span><span class="k">select</span><span class="w"> </span><span class="k">count</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="n">c_custkey</span><span class="w"> </span><span class="k">order</span><span class="w"> </span><span class="k">by</span><span class="w"> </span><span class="n">c_custkey</span><span class="p">)</span><span class="w"> </span><span class="k">from</span><span class="w"> </span><span class="n">customer1</span><span class="p">;</span>
<span class="w"> </span>
<span class="w"> </span><span class="n">QUERY</span><span class="w"> </span><span class="n">PLAN</span><span class="w"> </span> <span class="w"> </span><span class="n">QUERY</span><span class="w"> </span><span class="n">PLAN</span><span class="w"> </span>
<span class="c1">------------------------------------------------------------------ Aggregate (cost=2.50..2.51 rows=1 width=8)</span> <span class="c1">------------------------------------------------------------------ Aggregate (cost=2.50..2.51 rows=1 width=8)</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="k">count</span><span class="p">(</span><span class="n">customer1</span><span class="p">.</span><span class="n">c_custkey</span><span class="w"> </span><span class="k">ORDER</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">customer1</span><span class="p">.</span><span class="n">c_custkey</span><span class="p">)</span> <span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="k">count</span><span class="p">(</span><span class="n">customer1</span><span class="p">.</span><span class="n">c_custkey</span><span class="w"> </span><span class="k">ORDER</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">customer1</span><span class="p">.</span><span class="n">c_custkey</span><span class="p">)</span>

View File

@ -389,7 +389,7 @@
create table sub_table(a int, b int); create table sub_table(a int, b int);
select a from master_table group by a having a in (select a from sub_table); </pre> select a from master_table group by a having a in (select a from sub_table); </pre>
<p id="EN-US_TOPIC_0000002124196981__p15770mcpsimp">In this example, a correlated subquery is contained. To improve the query performance, you can change <strong id="EN-US_TOPIC_0000002124196981__b430651739112821">sub_table</strong> to a replication table and create an index on the <strong id="EN-US_TOPIC_0000002124196981__b1383751718112821">a</strong> column.</p> <p id="EN-US_TOPIC_0000002124196981__p15770mcpsimp">In this example, a correlated subquery is contained. To improve the query performance, you can change <strong id="EN-US_TOPIC_0000002124196981__b430651739112821">sub_table</strong> to a replication table and create an index on the <strong id="EN-US_TOPIC_0000002124196981__b1383751718112821">a</strong> column.</p>
<p id="EN-US_TOPIC_0000002124196981__p15771mcpsimp"><strong id="EN-US_TOPIC_0000002124196981__b9514317154716">Example 2:</strong> Modify the SELECT statement by changing the subquery to a JOIN relationship between the primary table and the parent query or modifying the subquery to improve the query performance. Ensure that the subquery to be used is semantically correct.</p> <p id="EN-US_TOPIC_0000002124196981__p15771mcpsimp"><strong id="EN-US_TOPIC_0000002124196981__b9514317154716">Example 2:</strong> Modify the SELECT statement by changing the subquery to a JOIN relationship between the main table and the parent query or modifying the subquery to improve the query performance. Ensure that the subquery to be used is semantically correct.</p>
<pre class="screen" id="EN-US_TOPIC_0000002124196981__screen15773mcpsimp">explain (costs off)select * from master_table as t1 where t1.a in (select t2.a from sub_table as t2 where t1.a = t2.b); <pre class="screen" id="EN-US_TOPIC_0000002124196981__screen15773mcpsimp">explain (costs off)select * from master_table as t1 where t1.a in (select t2.a from sub_table as t2 where t1.a = t2.b);
QUERY PLAN QUERY PLAN
---------------------------------------------------------- ----------------------------------------------------------

View File

@ -12,7 +12,8 @@
<tbody><tr id="EN-US_TOPIC_0000002124277441__row15992mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p15994mcpsimp">enable_nestloop=on</p> <tbody><tr id="EN-US_TOPIC_0000002124277441__row15992mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p15994mcpsimp">enable_nestloop=on</p>
</td> </td>
<td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p15996mcpsimp">Specifies how the optimizer uses <strong id="EN-US_TOPIC_0000002124277441__b1542243565112849">Nest Loop Join</strong>. If this parameter is set to <strong id="EN-US_TOPIC_0000002124277441__b1002931103112849">on</strong>, the optimizer preferentially uses <strong id="EN-US_TOPIC_0000002124277441__b2143758634112849">Nest Loop Join</strong>. If it is set to <strong id="EN-US_TOPIC_0000002124277441__b2061089499112849">off</strong>, the optimizer preferentially uses other methods, if any.</p> <td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p15996mcpsimp">Specifies how the optimizer uses <strong id="EN-US_TOPIC_0000002124277441__b1542243565112849">Nest Loop Join</strong>. If this parameter is set to <strong id="EN-US_TOPIC_0000002124277441__b1002931103112849">on</strong>, the optimizer preferentially uses <strong id="EN-US_TOPIC_0000002124277441__b2143758634112849">Nest Loop Join</strong>. If it is set to <strong id="EN-US_TOPIC_0000002124277441__b2061089499112849">off</strong>, the optimizer preferentially uses other methods, if any.</p>
<div class="note" id="EN-US_TOPIC_0000002124277441__note15997mcpsimp"><span class="notetitle"> NOTE: </span><div class="notebody">If you only want to temporarily change the value of this parameter during the current database connection (or the current session), execute the following SQL statement:</div></div> <div class="note" id="EN-US_TOPIC_0000002124277441__note15997mcpsimp"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0000002124277441__p125518197413">If you only want to temporarily change the value of this parameter during the current database connection (or the current session), execute the following SQL statement:</p>
</div></div>
<p id="EN-US_TOPIC_0000002124277441__p15998mcpsimp">SET enable_nestloop to off;</p> <p id="EN-US_TOPIC_0000002124277441__p15998mcpsimp">SET enable_nestloop to off;</p>
<p id="EN-US_TOPIC_0000002124277441__p15999mcpsimp">You can determine whether to disable this function based on the actual requirements. Generally, among the three join modes (Nested Loop, Merge Join, and Hash Join), Nested Loop is suitable for scenarios with small data volume or indexes, and Hash Join is suitable for big data analysis.</p> <p id="EN-US_TOPIC_0000002124277441__p15999mcpsimp">You can determine whether to disable this function based on the actual requirements. Generally, among the three join modes (Nested Loop, Merge Join, and Hash Join), Nested Loop is suitable for scenarios with small data volume or indexes, and Hash Join is suitable for big data analysis.</p>
</td> </td>
@ -20,7 +21,8 @@
<tr id="EN-US_TOPIC_0000002124277441__row16000mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16002mcpsimp">enable_bitmapscan=on</p> <tr id="EN-US_TOPIC_0000002124277441__row16000mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16002mcpsimp">enable_bitmapscan=on</p>
</td> </td>
<td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16004mcpsimp">Specifies whether the optimizer uses bitmap scanning. If the value is <strong id="EN-US_TOPIC_0000002124277441__b849036611112849">on</strong>, bitmap scanning is used. If the value is <strong id="EN-US_TOPIC_0000002124277441__b745439336112849">off</strong>, it is not used.</p> <td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16004mcpsimp">Specifies whether the optimizer uses bitmap scanning. If the value is <strong id="EN-US_TOPIC_0000002124277441__b849036611112849">on</strong>, bitmap scanning is used. If the value is <strong id="EN-US_TOPIC_0000002124277441__b745439336112849">off</strong>, it is not used.</p>
<div class="note" id="EN-US_TOPIC_0000002124277441__note16005mcpsimp"><span class="notetitle"> NOTE: </span><div class="notebody">If you only want to temporarily change the value of this parameter during the current database connection (or the current session), execute the following SQL statement:</div></div> <div class="note" id="EN-US_TOPIC_0000002124277441__note16005mcpsimp"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0000002124277441__p32570190417">If you only want to temporarily change the value of this parameter during the current database connection (or the current session), execute the following SQL statement:</p>
</div></div>
<p id="EN-US_TOPIC_0000002124277441__p16006mcpsimp">SET enable_bitmapscan to off;</p> <p id="EN-US_TOPIC_0000002124277441__p16006mcpsimp">SET enable_bitmapscan to off;</p>
<p id="EN-US_TOPIC_0000002124277441__p16007mcpsimp">The bitmap scan applies only in the query condition where <strong id="EN-US_TOPIC_0000002124277441__b84235270613173">a &gt; 1 and b &gt; 1</strong> is used and indexes are created on columns <strong id="EN-US_TOPIC_0000002124277441__b842352706205816">a</strong> and <strong id="EN-US_TOPIC_0000002124277441__b842352706205820">b</strong>. It sometimes does not perform as well as index scan. During performance tuning, if the query performance is poor and bitmapscan operators are in the execution plan, set this parameter to <strong id="EN-US_TOPIC_0000002124277441__b1556915994112849">off</strong> and check whether the performance is improved.</p> <p id="EN-US_TOPIC_0000002124277441__p16007mcpsimp">The bitmap scan applies only in the query condition where <strong id="EN-US_TOPIC_0000002124277441__b84235270613173">a &gt; 1 and b &gt; 1</strong> is used and indexes are created on columns <strong id="EN-US_TOPIC_0000002124277441__b842352706205816">a</strong> and <strong id="EN-US_TOPIC_0000002124277441__b842352706205820">b</strong>. It sometimes does not perform as well as index scan. During performance tuning, if the query performance is poor and bitmapscan operators are in the execution plan, set this parameter to <strong id="EN-US_TOPIC_0000002124277441__b1556915994112849">off</strong> and check whether the performance is improved.</p>
</td> </td>
@ -28,7 +30,8 @@
<tr id="EN-US_TOPIC_0000002124277441__row16008mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16010mcpsimp">enable_fast_query_shipping=on</p> <tr id="EN-US_TOPIC_0000002124277441__row16008mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16010mcpsimp">enable_fast_query_shipping=on</p>
</td> </td>
<td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16012mcpsimp">Specifies whether the optimizer uses a distribution framework. If its value is <strong id="EN-US_TOPIC_0000002124277441__b12329649">on</strong>, the execution plan is generated on both CNs and DNs. If the value is <strong id="EN-US_TOPIC_0000002124277441__b1084894937162137">off</strong>, the distribution framework is used. The execution plan is generated on CNs and then sent to DNs for execution.</p> <td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16012mcpsimp">Specifies whether the optimizer uses a distribution framework. If its value is <strong id="EN-US_TOPIC_0000002124277441__b12329649">on</strong>, the execution plan is generated on both CNs and DNs. If the value is <strong id="EN-US_TOPIC_0000002124277441__b1084894937162137">off</strong>, the distribution framework is used. The execution plan is generated on CNs and then sent to DNs for execution.</p>
<div class="note" id="EN-US_TOPIC_0000002124277441__note16013mcpsimp"><span class="notetitle"> NOTE: </span><div class="notebody">If you only want to temporarily change the value of this parameter during the current database connection (or the current session), execute the following SQL statement:</div></div> <div class="note" id="EN-US_TOPIC_0000002124277441__note16013mcpsimp"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0000002124277441__p2258181913417">If you only want to temporarily change the value of this parameter during the current database connection (or the current session), execute the following SQL statement:</p>
</div></div>
<p id="EN-US_TOPIC_0000002124277441__p16014mcpsimp">SET enable_fast_query_shipping to off;</p> <p id="EN-US_TOPIC_0000002124277441__p16014mcpsimp">SET enable_fast_query_shipping to off;</p>
</td> </td>
</tr> </tr>
@ -39,7 +42,7 @@
</tr> </tr>
<tr id="EN-US_TOPIC_0000002124277441__row16020mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16022mcpsimp">enable_hashjoin=on</p> <tr id="EN-US_TOPIC_0000002124277441__row16020mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16022mcpsimp">enable_hashjoin=on</p>
</td> </td>
<td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16024mcpsimp">Specifies whether enable the optimizer's use of hash join plan types.</p> <td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16024mcpsimp">Specifies whether to enable the optimizer's use of hash join plan types.</p>
</td> </td>
</tr> </tr>
<tr id="EN-US_TOPIC_0000002124277441__row16025mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16027mcpsimp">enable_mergejoin=on</p> <tr id="EN-US_TOPIC_0000002124277441__row16025mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16027mcpsimp">enable_mergejoin=on</p>
@ -59,7 +62,7 @@
</tr> </tr>
<tr id="EN-US_TOPIC_0000002124277441__row16040mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16042mcpsimp">enable_seqscan=on</p> <tr id="EN-US_TOPIC_0000002124277441__row16040mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16042mcpsimp">enable_seqscan=on</p>
</td> </td>
<td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16044mcpsimp">Specifies whether enable the optimizer's use of sequential scan plan types. It is impossible to completely suppress sequential scans, but setting this parameter to <strong id="EN-US_TOPIC_0000002124277441__b41076330152658">off</strong> allows the optimizer to choose other methods if available.</p> <td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16044mcpsimp">Specifies whether to enable the optimizer's use of sequential scan plan types. It is impossible to completely suppress sequential scans, but setting this parameter to <strong id="EN-US_TOPIC_0000002124277441__b41076330152658">off</strong> allows the optimizer to choose other methods if available.</p>
</td> </td>
</tr> </tr>
<tr id="EN-US_TOPIC_0000002124277441__row16045mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16047mcpsimp">enable_sort=on</p> <tr id="EN-US_TOPIC_0000002124277441__row16045mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16047mcpsimp">enable_sort=on</p>
@ -69,7 +72,7 @@
</tr> </tr>
<tr id="EN-US_TOPIC_0000002124277441__row16050mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16052mcpsimp">enable_broadcast=on</p> <tr id="EN-US_TOPIC_0000002124277441__row16050mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16052mcpsimp">enable_broadcast=on</p>
</td> </td>
<td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16054mcpsimp">Specifies whether enable the optimizer's use of data broadcast. In data broadcast, a large amount of data is transferred on the network. When the number of transmission nodes (stream) is large and the estimation is inaccurate, set this parameter to <strong id="EN-US_TOPIC_0000002124277441__b1408758084112849">off</strong> and check whether the performance is improved.</p> <td class="cellrowborder" valign="top" width="73%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000002124277441__p16054mcpsimp">Specifies whether to enable the optimizer's use of data broadcast. In data broadcast, a large amount of data is transferred on the network. When the number of transmission nodes (stream) is large and the estimation is inaccurate, set this parameter to <strong id="EN-US_TOPIC_0000002124277441__b1408758084112849">off</strong> and check whether the performance is improved.</p>
</td> </td>
</tr> </tr>
<tr id="EN-US_TOPIC_0000002124277441__row16055mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16057mcpsimp">rewrite_rule</p> <tr id="EN-US_TOPIC_0000002124277441__row16055mcpsimp"><td class="cellrowborder" valign="top" width="27%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000002124277441__p16057mcpsimp">rewrite_rule</p>

View File

@ -18,7 +18,7 @@
</li> </li>
<li class="ulchildlink"><strong><a href="opengauss_tips_0021.html">DELETE</a></strong><br> <li class="ulchildlink"><strong><a href="opengauss_tips_0021.html">DELETE</a></strong><br>
</li> </li>
<li class="ulchildlink"><strong><a href="opengauss_tips_0022.html">Associated Query</a></strong><br> <li class="ulchildlink"><strong><a href="opengauss_tips_0022.html">Join Query</a></strong><br>
</li> </li>
<li class="ulchildlink"><strong><a href="opengauss_tips_0023.html">Subqueries</a></strong><br> <li class="ulchildlink"><strong><a href="opengauss_tips_0023.html">Subqueries</a></strong><br>
</li> </li>

View File

@ -50,7 +50,7 @@
</tr> </tr>
<tr id="EN-US_TOPIC_0000002124196909__row1421mcpsimp"><td class="cellrowborder" valign="top" headers="mcps1.3.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0000002124196909__p1423mcpsimp">Any precision</p> <tr id="EN-US_TOPIC_0000002124196909__row1421mcpsimp"><td class="cellrowborder" valign="top" headers="mcps1.3.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0000002124196909__p1423mcpsimp">Any precision</p>
</td> </td>
<td class="cellrowborder" valign="top" headers="mcps1.3.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0000002124196909__p1425mcpsimp">NUMERIC/DEMICAL</p> <td class="cellrowborder" valign="top" headers="mcps1.3.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0000002124196909__p1425mcpsimp">NUMERIC/DECIMAL</p>
</td> </td>
</tr> </tr>
<tr id="EN-US_TOPIC_0000002124196909__row1426mcpsimp"><td class="cellrowborder" valign="top" headers="mcps1.3.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0000002124196909__p1428mcpsimp">Floating point</p> <tr id="EN-US_TOPIC_0000002124196909__row1426mcpsimp"><td class="cellrowborder" valign="top" headers="mcps1.3.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0000002124196909__p1428mcpsimp">Floating point</p>

View File

@ -36,7 +36,7 @@
</tr> </tr>
<tr id="EN-US_TOPIC_0000002124197105__row18625151618473"><td class="cellrowborder" valign="top" width="27.55%" headers="mcps1.3.1.1.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002124197105__p1662517169471">Any precision</p> <tr id="EN-US_TOPIC_0000002124197105__row18625151618473"><td class="cellrowborder" valign="top" width="27.55%" headers="mcps1.3.1.1.4.2.4.1.1 "><p id="EN-US_TOPIC_0000002124197105__p1662517169471">Any precision</p>
</td> </td>
<td class="cellrowborder" valign="top" width="51.019999999999996%" headers="mcps1.3.1.1.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002124197105__p26251916124716">NUMERIC/DEMICAL</p> <td class="cellrowborder" valign="top" width="51.019999999999996%" headers="mcps1.3.1.1.4.2.4.1.2 "><p id="EN-US_TOPIC_0000002124197105__p26251916124716">NUMERIC/DECIMAL</p>
</td> </td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.1.1.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002124197105__p15625201619477">Yes</p> <td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.1.1.4.2.4.1.3 "><p id="EN-US_TOPIC_0000002124197105__p15625201619477">Yes</p>
</td> </td>

View File

@ -30,7 +30,7 @@
</li><li id="EN-US_TOPIC_0000002088517538__li1871894555312">For a distributed hash table, the primary key and unique index must contain distribution keys.</li><li id="EN-US_TOPIC_0000002088517538__li151945383542">Properly design composite indexes to avoid redundancy.<p id="EN-US_TOPIC_0000002088517538__p328912558541"><a name="EN-US_TOPIC_0000002088517538__li151945383542"></a><a name="li151945383542"></a>For example, if an index has been created for <strong id="EN-US_TOPIC_0000002088517538__b15501135917618">(a, b, c)</strong>, you shall not create an index for <strong id="EN-US_TOPIC_0000002088517538__b3502659768">(a)</strong>, <strong id="EN-US_TOPIC_0000002088517538__b1750218591067">(b)</strong>, <strong id="EN-US_TOPIC_0000002088517538__b3502759469">(c)</strong>, <strong id="EN-US_TOPIC_0000002088517538__b10503859361">(a, b)</strong>, or <strong id="EN-US_TOPIC_0000002088517538__b205036591768">(b, c)</strong> independently.</p> </li><li id="EN-US_TOPIC_0000002088517538__li1871894555312">For a distributed hash table, the primary key and unique index must contain distribution keys.</li><li id="EN-US_TOPIC_0000002088517538__li151945383542">Properly design composite indexes to avoid redundancy.<p id="EN-US_TOPIC_0000002088517538__p328912558541"><a name="EN-US_TOPIC_0000002088517538__li151945383542"></a><a name="li151945383542"></a>For example, if an index has been created for <strong id="EN-US_TOPIC_0000002088517538__b15501135917618">(a, b, c)</strong>, you shall not create an index for <strong id="EN-US_TOPIC_0000002088517538__b3502659768">(a)</strong>, <strong id="EN-US_TOPIC_0000002088517538__b1750218591067">(b)</strong>, <strong id="EN-US_TOPIC_0000002088517538__b3502759469">(c)</strong>, <strong id="EN-US_TOPIC_0000002088517538__b10503859361">(a, b)</strong>, or <strong id="EN-US_TOPIC_0000002088517538__b205036591768">(b, c)</strong> independently.</p>
<p id="EN-US_TOPIC_0000002088517538__p49941010195517">If only the filtering condition of the <strong id="EN-US_TOPIC_0000002088517538__b13463203421512">a</strong> column is used for a query, composite indexes are used for the query as well.</p> <p id="EN-US_TOPIC_0000002088517538__p49941010195517">If only the filtering condition of the <strong id="EN-US_TOPIC_0000002088517538__b13463203421512">a</strong> column is used for a query, composite indexes are used for the query as well.</p>
</li><li id="EN-US_TOPIC_0000002088517538__li863417427542">Do not create multiple unique indexes for a single table.<p id="EN-US_TOPIC_0000002088517538__p16289145515418"><a name="EN-US_TOPIC_0000002088517538__li863417427542"></a><a name="li863417427542"></a>Maintaining multiple unique indexes at the same time generates more overheads than maintaining a multi-column unique index. If multiple unique indexes are equivalent to a multi-column unique index in service logic, a multi-column unique index shall be preferred.</p> </li><li id="EN-US_TOPIC_0000002088517538__li863417427542">Do not create multiple unique indexes for a single table.<p id="EN-US_TOPIC_0000002088517538__p16289145515418"><a name="EN-US_TOPIC_0000002088517538__li863417427542"></a><a name="li863417427542"></a>Maintaining multiple unique indexes at the same time generates more overheads than maintaining a multi-column unique index. If multiple unique indexes are equivalent to a multi-column unique index in service logic, a multi-column unique index shall be preferred.</p>
</li><li id="EN-US_TOPIC_0000002088517538__li10940174810547">A composite index contains up to 5 columns.</li><li id="EN-US_TOPIC_0000002088517538__li14882130165518">The total length of the combined character string of a composite index cannot exceed 200.</li><li id="EN-US_TOPIC_0000002088517538__li9956133513554">Index (including single-column and composite indexes) columns must be NOT NULL.</li><li id="EN-US_TOPIC_0000002088517538__li18795164015556">The efficiency of maintaining indexes created for the same column is different. Columns of the number type are better than those of the character type and other data types. Therefore, it is recommended that columns such as IDs and time for creating indexes be stored as data of the number type.</li><li id="EN-US_TOPIC_0000002088517538__li579624845516">You are advised to create an index on the associated column.<p id="EN-US_TOPIC_0000002088517538__p7267618568"><a name="EN-US_TOPIC_0000002088517538__li579624845516"></a><a name="li579624845516"></a>HASH JOIN is supported, whereas NESTLOOP JOIN may be used for join operations if the rescan cost is low (for example, the internal table is small). If the NESTLOOP JOIN plan can be viewed by executing EXPLAIN, you can create indexes on joined columns to improve the efficiency of NESTLOOP JOIN.</p> </li><li id="EN-US_TOPIC_0000002088517538__li10940174810547">A composite index contains up to 5 columns.</li><li id="EN-US_TOPIC_0000002088517538__li14882130165518">The total length of the combined character string of a composite index cannot exceed 200.</li><li id="EN-US_TOPIC_0000002088517538__li9956133513554">Index (including single-column and composite indexes) columns must be NOT NULL.</li><li id="EN-US_TOPIC_0000002088517538__li18795164015556">The efficiency of maintaining indexes created for the same column is different. Columns of the number type are better than those of the character type and other data types. Therefore, it is recommended that columns such as IDs and time for creating indexes be stored as data of the number type.</li><li id="EN-US_TOPIC_0000002088517538__li579624845516">You are advised to create an index on the join column.<p id="EN-US_TOPIC_0000002088517538__p7267618568"><a name="EN-US_TOPIC_0000002088517538__li579624845516"></a><a name="li579624845516"></a>HASH JOIN is supported, whereas NESTLOOP JOIN may be used for join operations if the rescan cost is low (for example, the internal table is small). If the NESTLOOP JOIN plan can be viewed by executing EXPLAIN, you can create indexes on joined columns to improve the efficiency of NESTLOOP JOIN.</p>
</li></ul> </li></ul>
</div> </div>
<div> <div>

View File

@ -19,7 +19,7 @@
<p id="EN-US_TOPIC_0000002088517694__p1953053112266"><strong id="EN-US_TOPIC_0000002088517694__b3530231192610">ANALYZE</strong>;</p> <p id="EN-US_TOPIC_0000002088517694__p1953053112266"><strong id="EN-US_TOPIC_0000002088517694__b3530231192610">ANALYZE</strong>;</p>
<p id="EN-US_TOPIC_0000002088517694__p13530731122618">-- Analyze the specified table.</p> <p id="EN-US_TOPIC_0000002088517694__p13530731122618">-- Analyze the specified table.</p>
<p id="EN-US_TOPIC_0000002088517694__p25301313261"><strong id="EN-US_TOPIC_0000002088517694__b25309311265">ANALYZE </strong>tablename;</p> <p id="EN-US_TOPIC_0000002088517694__p25301313261"><strong id="EN-US_TOPIC_0000002088517694__b25309311265">ANALYZE </strong>tablename;</p>
</li><li id="EN-US_TOPIC_0000002088517694__li154558513261">This event is triggered when the number of rows added or deleted at a specified interval or in a table reaches a specified value by using AUTO VACCUUM. The interval and addition/deletion ratio can be configured through the GUC parameters.</li></ul> </li><li id="EN-US_TOPIC_0000002088517694__li154558513261">This event is triggered when the number of rows added or deleted at a specified interval or in a table reaches a specified value by using AUTO VACUUM. The interval and addition/deletion ratio can be configured through the GUC parameters.</li></ul>
</div></div> </div></div>
<p id="EN-US_TOPIC_0000002088517694__p1794122792611"></p> <p id="EN-US_TOPIC_0000002088517694__p1794122792611"></p>
</li></ul> </li></ul>

View File

@ -2,7 +2,7 @@
<h1 class="topictitle1">DELETE</h1> <h1 class="topictitle1">DELETE</h1>
<div id="body0000001181237426"><ul id="EN-US_TOPIC_0000002124197157__ul196418118321"><li id="EN-US_TOPIC_0000002124197157__li14641911153216">LIMIT cannot be used in the DELETE statement. The WHERE condition should be used to specify the target row to be deleted.</li><li id="EN-US_TOPIC_0000002124197157__li1864191133220">In GMT-free mode, cross-node transactions are not allowed. Therefore, when deleting a data table distributed by hash, you must specify the equal condition in the WHERE condition for the distributed columns.</li><li id="EN-US_TOPIC_0000002124197157__li1664181117329">Deleting multiple tables is not supported.<p id="EN-US_TOPIC_0000002124197157__p12499420133211"><a name="EN-US_TOPIC_0000002124197157__li1664181117329"></a><a name="li1664181117329"></a>Multi-table deletion indicates that multiple tables are deleted in a single SQL statement.</p> <div id="body0000001181237426"><ul id="EN-US_TOPIC_0000002124197157__ul196418118321"><li id="EN-US_TOPIC_0000002124197157__li14641911153216">LIMIT cannot be used in the DELETE statement. The WHERE condition should be used to specify the target row to be deleted.</li><li id="EN-US_TOPIC_0000002124197157__li1864191133220">In GMT-free mode, cross-node transactions are not allowed. Therefore, when deleting a data table distributed by hash, you must specify the equal condition in the WHERE condition for the distributed columns.</li><li id="EN-US_TOPIC_0000002124197157__li1664181117329">Deleting multiple tables is not supported.<p id="EN-US_TOPIC_0000002124197157__p12499420133211"><a name="EN-US_TOPIC_0000002124197157__li1664181117329"></a><a name="li1664181117329"></a>Multi-table deletion indicates that multiple tables are deleted in a single SQL statement.</p>
</li><li id="EN-US_TOPIC_0000002124197157__li9651811163217">The DELETE statement must contain the WHERE clause to avoid full table scanning.</li><li id="EN-US_TOPIC_0000002124197157__li13651711193214">Do not use the ORDER BY or GROUP BY clause in the DELETE statement to avoid unnecessary sorting.</li><li id="EN-US_TOPIC_0000002124197157__li5332622163220">Use TRUNCATE instead of DELETE to clear a table.<p id="EN-US_TOPIC_0000002124197157__p2551183417327"><a name="EN-US_TOPIC_0000002124197157__li5332622163220"></a><a name="li5332622163220"></a>TRUNCATE creates a new physical file and physically deletes the original file when the transaction ends to clear the disk space. However, the DELETE statement marks data in the table and does not clear the disk space until the VACCUUM FULL phase.</p> </li><li id="EN-US_TOPIC_0000002124197157__li9651811163217">The DELETE statement must contain the WHERE clause to avoid full table scanning.</li><li id="EN-US_TOPIC_0000002124197157__li13651711193214">Do not use the ORDER BY or GROUP BY clause in the DELETE statement to avoid unnecessary sorting.</li><li id="EN-US_TOPIC_0000002124197157__li5332622163220">Use TRUNCATE instead of DELETE to clear a table.<p id="EN-US_TOPIC_0000002124197157__p2551183417327"><a name="EN-US_TOPIC_0000002124197157__li5332622163220"></a><a name="li5332622163220"></a>TRUNCATE creates a new physical file and physically deletes the original file when the transaction ends to clear the disk space. However, the DELETE statement marks data in the table and does not clear the disk space until the VACUUM FULL phase.</p>
</li><li id="EN-US_TOPIC_0000002124197157__li865103773217">If a DELETE statement is executed on a table that has a primary key or index, the WHERE condition must be used together with the primary key or index to improve execution efficiency.</li></ul> </li><li id="EN-US_TOPIC_0000002124197157__li865103773217">If a DELETE statement is executed on a table that has a primary key or index, the WHERE condition must be used together with the primary key or index to improve execution efficiency.</li></ul>
</div> </div>
<div> <div>

View File

@ -1,14 +1,14 @@
<a name="EN-US_TOPIC_0000002088517514"></a><a name="EN-US_TOPIC_0000002088517514"></a> <a name="EN-US_TOPIC_0000002088517514"></a><a name="EN-US_TOPIC_0000002088517514"></a>
<h1 class="topictitle1">Associated Query</h1> <h1 class="topictitle1">Join Query</h1>
<div id="body0000001181555908"><ul id="EN-US_TOPIC_0000002088517514__ul17976821123317"><li id="EN-US_TOPIC_0000002088517514__li6976122123319">The nesting depth of multi-table association must be less than 8.<p id="EN-US_TOPIC_0000002088517514__p18835318143312"><a name="EN-US_TOPIC_0000002088517514__li6976122123319"></a><a name="li6976122123319"></a>If the association nesting is too deep, slow SQL statements may be generated. You need to optimize the association nesting at the service layer.</p> <div id="body0000001181555908"><ul id="EN-US_TOPIC_0000002088517514__ul17976821123317"><li id="EN-US_TOPIC_0000002088517514__li6976122123319">The nesting depth of multi-table association must be less than 8.<p id="EN-US_TOPIC_0000002088517514__p18835318143312"><a name="EN-US_TOPIC_0000002088517514__li6976122123319"></a><a name="li6976122123319"></a>If the association nesting is too deep, slow SQL statements may be generated. You need to optimize the association nesting at the service layer.</p>
</li><li id="EN-US_TOPIC_0000002088517514__li38205249332">When tables are associated for query, the join condition (ON) of each table must be specified to avoid Cartesian product.<p id="EN-US_TOPIC_0000002088517514__p14577123593319"><a name="EN-US_TOPIC_0000002088517514__li38205249332"></a><a name="li38205249332"></a>For example, in MySQL, JOIN is equivalent to CROSS JOIN and INNER JOIN. However, in the SQL standards, JOIN is equivalent to INNER JOIN only and must be used together with the ON condition.</p> </li><li id="EN-US_TOPIC_0000002088517514__li38205249332">When tables are joined for query, the join condition (ON) of each table must be specified to avoid Cartesian product.<p id="EN-US_TOPIC_0000002088517514__p14577123593319"><a name="EN-US_TOPIC_0000002088517514__li38205249332"></a><a name="li38205249332"></a>For example, in MySQL, JOIN is equivalent to CROSS JOIN and INNER JOIN. However, in the SQL standards, JOIN is equivalent to INNER JOIN only and must be used together with the ON condition.</p>
<p id="EN-US_TOPIC_0000002088517514__p4715168173417">Negative examples: The following query statements return a Cartesian product:</p> <p id="EN-US_TOPIC_0000002088517514__p4715168173417">Negative examples: The following query statements return a Cartesian product:</p>
<p id="EN-US_TOPIC_0000002088517514__p11388131014346"><strong id="EN-US_TOPIC_0000002088517514__b657818178382">SELECT * FROM TABLE1 A , TABLE2 B;</strong></p> <p id="EN-US_TOPIC_0000002088517514__p11388131014346"><strong id="EN-US_TOPIC_0000002088517514__b657818178382">SELECT * FROM TABLE1 A , TABLE2 B;</strong></p>
<p id="EN-US_TOPIC_0000002088517514__p1663610212410"><strong id="EN-US_TOPIC_0000002088517514__b5612417103819">SELECT * FROM TABLE1 A JOIN TABLE2 B ON 1=1;</strong></p> <p id="EN-US_TOPIC_0000002088517514__p1663610212410"><strong id="EN-US_TOPIC_0000002088517514__b5612417103819">SELECT * FROM TABLE1 A JOIN TABLE2 B ON 1=1;</strong></p>
</li><li id="EN-US_TOPIC_0000002088517514__li595522923313">The JOIN mode must be specified based on the SQL standards during association. Do not use the JOIN keyword directly. Instead, use CROSS JOIN, INNER JOIN, LEFT JOIN, or RIGHT JOIN.</li><li id="EN-US_TOPIC_0000002088517514__li64813131735">When multiple tables are associated for query, aliases shall be added to the tables to ensure that the statement logic is clear and easy to maintain.</li><li id="EN-US_TOPIC_0000002088517514__li114900171235">Different columns have different comparison overheads. You are advised to use a field type with high efficiency for associated columns.<p id="EN-US_TOPIC_0000002088517514__p166841528134"><a name="EN-US_TOPIC_0000002088517514__li114900171235"></a><a name="li114900171235"></a>The comparison efficiency of the numeric type is much higher than that of the string type.</p> </li><li id="EN-US_TOPIC_0000002088517514__li595522923313">The JOIN mode must be specified based on the SQL standards during association. Do not use the JOIN keyword directly. Instead, use CROSS JOIN, INNER JOIN, LEFT JOIN, or RIGHT JOIN.</li><li id="EN-US_TOPIC_0000002088517514__li64813131735">When multiple tables are joined for query, aliases shall be added to the tables to ensure that the statement logic is clear and easy to maintain.</li><li id="EN-US_TOPIC_0000002088517514__li114900171235">Different columns have different comparison overheads. You are advised to use a field type with high efficiency for join columns.<p id="EN-US_TOPIC_0000002088517514__p166841528134"><a name="EN-US_TOPIC_0000002088517514__li114900171235"></a><a name="li114900171235"></a>The comparison efficiency of the numeric type is much higher than that of the string type.</p>
<p id="EN-US_TOPIC_0000002088517514__p1568432815312">The comparison efficiency of integers is much higher than that of numeric and floating-point types.</p> <p id="EN-US_TOPIC_0000002088517514__p1568432815312">The comparison efficiency of integers is much higher than that of numeric and floating-point types.</p>
</li><li id="EN-US_TOPIC_0000002088517514__li199691223314">The associated columns must be of the same data type to avoid the impact of implicit type conversion on the execution efficiency.</li><li id="EN-US_TOPIC_0000002088517514__li10553135538">You are advised use table association, instead of nested subqueries, because subqueries will generate temporary tables and greatly affect SQL performance.</li><li id="EN-US_TOPIC_0000002088517514__li354114516318">If a large number of NULL values exist in the associated columns, you are advised to add the IS NOT NULL condition to the WHERE condition to improve the execution efficiency.</li></ul> </li><li id="EN-US_TOPIC_0000002088517514__li199691223314">The join columns must be of the same data type to avoid the impact of implicit type conversion on the execution efficiency.</li><li id="EN-US_TOPIC_0000002088517514__li10553135538">You are advised use table association, instead of nested subqueries, because subqueries will generate temporary tables and greatly affect SQL performance.</li><li id="EN-US_TOPIC_0000002088517514__li354114516318">If a large number of NULL values exist in the join columns, you are advised to add the IS NOT NULL condition to the WHERE condition to improve the execution efficiency.</li></ul>
</div> </div>
<div> <div>
<div class="familylinks"> <div class="familylinks">

View File

@ -8,7 +8,7 @@
<p id="EN-US_TOPIC_0000002124277397__p55804121588">You are advised to modify the statement so that it can be executed on a single node. If the statement needs to be executed on multiple nodes, add a hint, for example, <strong id="EN-US_TOPIC_0000002124277397__b7587634581">insert /*+ multinode */ into t values(3,3),(1,1);</strong></p> <p id="EN-US_TOPIC_0000002124277397__p55804121588">You are advised to modify the statement so that it can be executed on a single node. If the statement needs to be executed on multiple nodes, add a hint, for example, <strong id="EN-US_TOPIC_0000002124277397__b7587634581">insert /*+ multinode */ into t values(3,3),(1,1);</strong></p>
<p id="EN-US_TOPIC_0000002124277397__p20215161914615">It is recommended that <strong id="EN-US_TOPIC_0000002124277397__b1291192218472">application_type</strong> is set to <strong id="EN-US_TOPIC_0000002124277397__b16652153714473">perfect_sharding_type</strong> in the JDBC connection string in the development phase. In this way, errors are reported for all cross-node read and write SQL statements, prompting developers to optimize statements as soon as possible.</p> <p id="EN-US_TOPIC_0000002124277397__p20215161914615">It is recommended that <strong id="EN-US_TOPIC_0000002124277397__b1291192218472">application_type</strong> is set to <strong id="EN-US_TOPIC_0000002124277397__b16652153714473">perfect_sharding_type</strong> in the JDBC connection string in the development phase. In this way, errors are reported for all cross-node read and write SQL statements, prompting developers to optimize statements as soon as possible.</p>
</li></ol> </li></ol>
</li><li id="EN-US_TOPIC_0000002124277397__li181031710560">Large object operations do not support transactions.<div class="note" id="EN-US_TOPIC_0000002124277397__note685015578613"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000002124277397__p198518571963">Large object operations include creating and deleting DATABASE, ANAYLIZE, and VACCUM jobs.</p> </li><li id="EN-US_TOPIC_0000002124277397__li181031710560">Large object operations do not support transactions.<div class="note" id="EN-US_TOPIC_0000002124277397__note685015578613"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000002124277397__p198518571963">Large object operations include creating and deleting DATABASE, ANAYLIZE, and VACUUM jobs.</p>
</div></div> </div></div>
</li><li id="EN-US_TOPIC_0000002124277397__li1543531397">Do not combine multiple SQL statements into one statement when accessing the database through JDBC<p id="EN-US_TOPIC_0000002124277397__p51631235913"><a name="EN-US_TOPIC_0000002124277397__li1543531397"></a><a name="li1543531397"></a>When multiple statements are combined into one statement that contains object operations, if the intermediate object operation fails, a new transaction is started to execute subsequent statements.</p> </li><li id="EN-US_TOPIC_0000002124277397__li1543531397">Do not combine multiple SQL statements into one statement when accessing the database through JDBC<p id="EN-US_TOPIC_0000002124277397__p51631235913"><a name="EN-US_TOPIC_0000002124277397__li1543531397"></a><a name="li1543531397"></a>When multiple statements are combined into one statement that contains object operations, if the intermediate object operation fails, a new transaction is started to execute subsequent statements.</p>
<p id="EN-US_TOPIC_0000002124277397__p1252214101091">Example: The following statement does not meet the requirements.</p> <p id="EN-US_TOPIC_0000002124277397__p1252214101091">Example: The following statement does not meet the requirements.</p>