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

293 lines
75 KiB
HTML

<a name="EN-US_TOPIC_0000001614371009"></a><a name="EN-US_TOPIC_0000001614371009"></a>
<h1 class="topictitle1">SQL Execution Plan</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001188482136_en-us_topic_0000001233563189_a1e0fa245530744908b4411c762439d3b">An SQL execution plan is a node tree that displays the detailed steps performed when the <span id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001188482136_en-us_topic_0000001233563189_text215991742">GaussDB(DWS)</span> executes an SQL statement. Each step indicates a database operator, also called an execution operator.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001188482136_en-us_topic_0000001233563189_aca2729a5928e40c29e9b75c18f456aed">You can run the <strong id="EN-US_TOPIC_0000001614371009__b15402500484">EXPLAIN</strong> command to view the execution plan generated for each query by an optimizer. <strong id="EN-US_TOPIC_0000001614371009__b15652184414350">EXPLAIN</strong> outputs a row of information for each execution node, showing the basic node type and the expense estimate that the optimizer makes for executing the node.</p>
<div class="section" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_s33a790a7a44c443a891756b54f7b030b"><h4 class="sectiontitle">Execution Plan Information</h4><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a7071bf87821845cf8a3f77cd331a107c">In addition to setting different display formats for an execution plan, you can use different <strong id="EN-US_TOPIC_0000001614371009__b1602113106103342">EXPLAIN</strong> syntax to display execution plan information in detail. The common usages are as follows. For more usages, see <span id="EN-US_TOPIC_0000001614371009__ph97311938142211">"EXPLAIN Syntax" in <em id="EN-US_TOPIC_0000001614371009__i1840320351501">SQL Syntax Reference</em></span>.</p>
<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_u0247f55773834ef6ac2156e0257869fe"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lf2b8ec64529f44a29493f776e45098ca">EXPLAIN <em id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_af308ee71f19b4ba5ad0ba5f9c8a90a15">statement</em>: only generates an execution plan and does not execute. The <em id="EN-US_TOPIC_0000001614371009__i357530229103342">statement</em> indicates SQL statements.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lf45aac639fe44ed2a1467391a8e5e054">EXPLAIN ANALYZE <em id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a3a5596f018de4e9c9896a2da77a5b2fe">statement</em>: generates and executes an execution plan, and displays the execution summary. Then actual execution time statistics are added to the display, 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_0000001614371009__en-us_topic_0000001610880741_l10659f0ae8c24e50b11e0587adecd74b">EXPLAIN PERFORMANCE <em id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a63690b03a73a49968f2c05687cf743d1">statement</em>: generates and executes the execution plan, and displays all execution information.</li></ul>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ac60e6a1b4bb4419aac6799b4eca2c3f8">To measure the run time cost of each node in the execution plan, the current execution of <strong id="EN-US_TOPIC_0000001614371009__b695252001103342">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000001614371009__b1145812203103342">EXPLAIN PERFORMANCE</strong> adds profiling overhead to query execution. Running <strong id="EN-US_TOPIC_0000001614371009__b9221559134820">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000001614371009__b72221259204814">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.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p157271209356">Therefore, if an SQL statement is not finished after being running for a long time, run the <strong id="EN-US_TOPIC_0000001614371009__b227729329103342">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_0000001614371009__b1254685727103342">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000001614371009__b122988924103342">EXPLAIN PERFORMANCE</strong> statement to check the execution plan and information to locate the fault.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_aa3cbd346131544b782f695cde46650e1"><strong id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a1d64d9b50a0d424eb50ee680644e6f63">Description of common execution plan keywords:</strong></p>
<ol id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_o76f345c2b09242b7b2f9bffd1d20bb4e"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lae36a75671464837b12c8e055f5eae6d">Table access modes<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_u8eb4d57bbde64d8dbd17e1028b6d3ca3"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_le8312e6b64b24c45a8fec477efda0d5f">Seq Scan/CStore Scan<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a0ecb6cc41e984e0ba01f03447c2205c9"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_le8312e6b64b24c45a8fec477efda0d5f"></a><a name="en-us_topic_0000001610880741_le8312e6b64b24c45a8fec477efda0d5f"></a>Scans all rows of the table in sequence. These are basic scan operators, which are used to scan row-store and column-store tables in sequence.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_laac765e4fa5141b4851202d0cd4c8acc">Index Scan/CStore Index Scan<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p326013353238"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_laac765e4fa5141b4851202d0cd4c8acc"></a><a name="en-us_topic_0000001610880741_laac765e4fa5141b4851202d0cd4c8acc"></a>Scans indexes of row-store and column-store tables. There are indexes in row-store or column-store tables, and the condition column is the index column.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a3a064996fbe74355b5063035740c1af1">The optimizer uses a two-step plan: the child plan node visits an index to find the locations of rows matching the index condition, and then the upper plan node actually fetches those rows from the table itself. Fetching rows separately is much more expensive than reading them sequentially, but because not all pages of the table have to be visited, this is still cheaper than a sequential scan. The upper-layer planning node first sort the location of index identifier rows based on physical locations before reading them. This minimizes the independent capturing overhead.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a0105897789304f40a564dd479d308e87">If there are separate indexes on multiple columns referenced in <strong id="EN-US_TOPIC_0000001614371009__b955462414103342">WHERE</strong>, the optimizer might choose to use an <strong id="EN-US_TOPIC_0000001614371009__b2022819154103342">AND</strong> or <strong id="EN-US_TOPIC_0000001614371009__b758103445103342">OR</strong> combination of the indexes. However, this requires the visiting of both indexes, so it is not necessarily a win compared to using just one index and treating the other condition as a filter.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_afba26adf32f04d25b4ec4c31d3c64c4d">The following Index scans featured with different sorting mechanisms are involved:</p>
<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_u2d3b01fd8f884313987f77a048991223"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l2b5bf1251075498d8302f4e869b12e36">Bitmap Index Scan<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a9446d5b49f914600aa2c704ff92bcc1c"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l2b5bf1251075498d8302f4e869b12e36"></a><a name="en-us_topic_0000001610880741_l2b5bf1251075498d8302f4e869b12e36"></a>To use a bitmap index to capture a data page, you need to scan the index to obtain the bitmap and then scan the base table.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l8a28e37c1de84f0293007259546bb592">Index Scan using index_name<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a3c73806451a24e45925c307dec7c6fa7"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l8a28e37c1de84f0293007259546bb592"></a><a name="en-us_topic_0000001610880741_l8a28e37c1de84f0293007259546bb592"></a>Fetches table rows in index order, which makes them even more expensive to read. However, there are so few rows that the extra cost of sorting the row locations is unnecessary. This plan type is used mainly for queries fetching just a single row and queries having an <strong id="EN-US_TOPIC_0000001614371009__b337990642103342">ORDER BY</strong> condition that matches the index order, because no extra sorting step is needed to satisfy <strong id="EN-US_TOPIC_0000001614371009__b234423003103342">ORDER BY</strong>.</p>
</li></ul>
</li></ul>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lb05747f9f05c473aa1e6aa79319d5808">Table connection modes<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ufb2072b1c81c4ad88d9a2c91bb9d4aa7"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lc0e9b4a4e4004e06a52b1abbc98ca1ec">Nested Loop<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a58085128d70d45a9955ff7f6ce0f57bc"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lc0e9b4a4e4004e06a52b1abbc98ca1ec"></a><a name="en-us_topic_0000001610880741_lc0e9b4a4e4004e06a52b1abbc98ca1ec"></a>Nested-loop is used for queries that have a smaller data set connected. In a Nested-loop join, the foreign table drives the internal table and each row returned from the foreign table should have a matching row in the internal table. The returned result set of all queries should not exceed 10,000. The table that returns a smaller subset will work as a foreign table, and indexes are recommended for connection fields of the internal table.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ld83aaa5508044918abea77b036d0a7e9">(Sonic) Hash Join<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ae3bf89ab420748dbab4fb6bd63d7d435"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ld83aaa5508044918abea77b036d0a7e9"></a><a name="en-us_topic_0000001610880741_ld83aaa5508044918abea77b036d0a7e9"></a>A Hash join is used for large tables. The optimizer uses a hash join, in which rows of one table are entered into an in-memory hash table, after which the other table is scanned and the hash table is probed for matches to each row. Sonic and non-Sonic hash joins differ in their hash table structures, which do not affect the execution result set.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l8ebe3dedb2944aceb6a2d3f707315995">Merge Join<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p6579547415"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l8ebe3dedb2944aceb6a2d3f707315995"></a><a name="en-us_topic_0000001610880741_l8ebe3dedb2944aceb6a2d3f707315995"></a>In a merge join, data in the two joined tables is sorted by join columns. Then, data is extracted from the two tables to a sorted table for matching.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p95791741413">Merge join requires more resources for sorting and its performance is lower than that of hash join. If the source data has been sorted, it does not need to be sorted again when merge join is performed. In this case, the performance of merge join is better than that of hash join.</p>
</li></ul>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l0b3070943a38460fadcb86510bd3017d">Operators<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_u0b6c52180e994c41a43cf547af288fca"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l6f1e4ac08339420283d7417d050b796b">sort<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_adff25721e4404736a47151106de18959"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l6f1e4ac08339420283d7417d050b796b"></a><a name="en-us_topic_0000001610880741_l6f1e4ac08339420283d7417d050b796b"></a>Sorts the result set.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lcd69e551f8b540ce829f5056d9b78389">filter<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_a4551ceacaeaa4f6f839aa737d92e4abc"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lcd69e551f8b540ce829f5056d9b78389"></a><a name="en-us_topic_0000001610880741_lcd69e551f8b540ce829f5056d9b78389"></a>The <strong id="EN-US_TOPIC_0000001614371009__b1562439475103342">EXPLAIN</strong> output shows the <strong id="EN-US_TOPIC_0000001614371009__b1244620428103342">WHERE</strong> clause being applied as a <strong id="EN-US_TOPIC_0000001614371009__b1397897489103342">Filter</strong> condition attached to the <strong id="EN-US_TOPIC_0000001614371009__b1997385081103342">Seq Scan</strong> plan node. This means that the plan node checks the condition for each row it scans, and returns only the ones that meet the condition. The estimated number of output rows has been reduced because of the <strong id="EN-US_TOPIC_0000001614371009__b947594468103342">WHERE</strong> clause. However, the scan will still have to visit all 10000 rows. As a result, the cost is not decreased. It increases a bit (by 10000 x <strong id="EN-US_TOPIC_0000001614371009__b1318685565103342">cpu_operator_cost</strong>) to reflect the extra CPU time spent on checking the <strong id="EN-US_TOPIC_0000001614371009__b847386545103342">WHERE</strong> condition.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l3064bbee9cd146fc826c47149f62b89b">LIMIT<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ac59849b0a4054fc58ff86a0919aefc95"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l3064bbee9cd146fc826c47149f62b89b"></a><a name="en-us_topic_0000001610880741_l3064bbee9cd146fc826c47149f62b89b"></a><strong id="EN-US_TOPIC_0000001614371009__b1742088030103342">LIMIT</strong> limits the number of output execution results. If a <strong id="EN-US_TOPIC_0000001614371009__b150169362103342">LIMIT</strong> condition is added, not all rows are retrieved.</p>
</li></ul>
</li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_section5931172402013"><h4 class="sectiontitle">Execution Plan Display Format</h4><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p15140653163016"><span id="EN-US_TOPIC_0000001614371009__text2007854486">GaussDB(DWS)</span> provides four display formats: <strong id="EN-US_TOPIC_0000001614371009__b14558943102311">normal</strong>, <strong id="EN-US_TOPIC_0000001614371009__b155581843162311">pretty</strong>, <strong id="EN-US_TOPIC_0000001614371009__b14559174362312">summary</strong>, and <strong id="EN-US_TOPIC_0000001614371009__b16559104316237">run</strong>. You can change the display format of execution plans by setting <strong id="EN-US_TOPIC_0000001614371009__b405621184103342">explain_perf_mode</strong>.</p>
<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_u2f18dd73393d40fb8e43e9576ec3a6e9"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l137c1ab965184b41aefeb9871cf1c85a"><strong id="EN-US_TOPIC_0000001614371009__b1953569691103342">normal</strong> indicates that the default printing format is used. <a href="#EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_fig1273152712379">Figure 1</a> shows the display format.<div class="fignone" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_fig1273152712379"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_fig1273152712379"></a><a name="en-us_topic_0000001610880741_fig1273152712379"></a><span class="figcap"><b>Figure 1 </b>Example of an execution plan in normal format</span><br><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image4340192354315" src="figure/en-us_image_0000001614452181.png"></span></div>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lb2dc49cc36ff4f82b7b901d96074cea9"><strong id="EN-US_TOPIC_0000001614371009__b377432203103342">pretty</strong> indicates that the optimized display mode of <span id="EN-US_TOPIC_0000001614371009__text392856852103342">GaussDB(DWS)</span> is used. A new format contains a plan node ID, directly and effectively analyzing performance. <a href="#EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_fig098629163812">Figure 2</a> is an example.<div class="fignone" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_fig098629163812"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_fig098629163812"></a><a name="en-us_topic_0000001610880741_fig098629163812"></a><span class="figcap"><b>Figure 2 </b>Example of an execution plan using the pretty format</span><br><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image1698112933819" src="figure/en-us_image_0000001614571737.png"></span></div>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_l1a5ba1959c0a4c38b4610ce6520b1469"><strong id="EN-US_TOPIC_0000001614371009__b762519857103342">summary</strong> indicates that the analysis result based on such information is printed in addition to the printed information in the format specified by <strong id="EN-US_TOPIC_0000001614371009__b1710044633103342">pretty</strong>.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_lf53f1b60e3df4e14bb27ef0711022564"><strong id="EN-US_TOPIC_0000001614371009__b1191059341103342">run</strong> indicates that in addition to the printed information specified by <strong id="EN-US_TOPIC_0000001614371009__b1151456522103342">summary</strong>, the database exports the information as a CSV file.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001614371009__section1248661954419"><h4 class="sectiontitle">Common Types of Plans</h4><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p1092522613412">GaussDB(DWS) has three types of distributed plans:</p>
<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_ul26483820341"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_li36029407340">Fast Query Shipping (FQS) plan<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p37217139352"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_li36029407340"></a><a name="en-us_topic_0000001610880741_en-us_topic_0000001233563189_li36029407340"></a>The CN directly delivers statements to DNs. Each DN executes the statements independently and summarizes the execution results on the CN.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_li3184344123413">Stream plan<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p1369552633519"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_li3184344123413"></a><a name="en-us_topic_0000001610880741_en-us_topic_0000001233563189_li3184344123413"></a>The CN generates a plan for the statements to be executed and delivers the plan to DNs for execution. During the execution, DNs use the Stream operator to exchange data.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_li1465123811340">Remote-Query plan<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p143898129369"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_li1465123811340"></a><a name="en-us_topic_0000001610880741_en-us_topic_0000001233563189_li1465123811340"></a>After generating a plan, the CN delivers some statements to DNs. Each DN executes the statements independently and sends the execution result to the CN. The CN executes the remaining statements in the plan.</p>
</li></ul>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p1942615144303">The existing tables <strong id="EN-US_TOPIC_0000001614371009__b313951413371">tt01</strong> and <strong id="EN-US_TOPIC_0000001614371009__b1123161883713">tt02</strong> are defined as follows:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_screen724114513362"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">tt01</span><span class="p">(</span><span class="n">c1</span><span class="w"> </span><span class="nb">int</span><span class="p">,</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="nb">int</span><span class="p">)</span><span class="w"> </span><span class="n">DISTRIBUTE</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">hash</span><span class="p">(</span><span class="n">c1</span><span class="p">);</span>
<span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">tt02</span><span class="p">(</span><span class="n">c1</span><span class="w"> </span><span class="nb">int</span><span class="p">,</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="nb">int</span><span class="p">)</span><span class="w"> </span><span class="n">DISTRIBUTE</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">hash</span><span class="p">(</span><span class="n">c2</span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p1836334544113"><strong id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_b1454882174216">Type 1: FQS plan, all statements pushed down</strong></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p292184044414">Two tables are joined, and the join condition is the distribution column of each table. If the stream operator is disabled, the CN directly sends statements to each DN for execution. The result is summarized on the CN.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_screen14266420124420"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SET</span><span class="w"> </span><span class="n">enable_stream_operator</span><span class="o">=</span><span class="k">off</span><span class="p">;</span>
<span class="k">SET</span><span class="w"> </span><span class="n">explain_perf_mode</span><span class="o">=</span><span class="n">normal</span><span class="p">;</span>
<span class="k">EXPLAIN</span><span class="w"> </span><span class="p">(</span><span class="k">VERBOSE</span><span class="w"> </span><span class="k">on</span><span class="p">,</span><span class="n">COSTS</span><span class="w"> </span><span class="k">off</span><span class="p">)</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">tt01</span><span class="p">,</span><span class="n">tt02</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="o">=</span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span><span class="p">;</span>
<span class="w"> </span><span class="n">QUERY</span><span class="w"> </span><span class="n">PLAN</span>
<span class="c1">-------------------------------------------------------------------------------------------------------------------</span>
<span class="w"> </span><span class="k">Data</span><span class="w"> </span><span class="n">Node</span><span class="w"> </span><span class="n">Scan</span><span class="w"> </span><span class="k">on</span><span class="w"> </span><span class="ss">&quot;__REMOTE_FQS_QUERY__&quot;</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c2</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="n">Node</span><span class="o">/</span><span class="n">s</span><span class="p">:</span><span class="w"> </span><span class="k">All</span><span class="w"> </span><span class="n">datanodes</span>
<span class="w"> </span><span class="n">Remote</span><span class="w"> </span><span class="n">query</span><span class="p">:</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c2</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">dbadmin</span><span class="p">.</span><span class="n">tt01</span><span class="p">,</span><span class="w"> </span><span class="n">dbadmin</span><span class="p">.</span><span class="n">tt02</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="p">(</span><span class="mi">4</span><span class="w"> </span><span class="k">rows</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p16832172284312"><strong id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_b16845167114517">Type 2: Non-FQS plan, some statements pushed down</strong></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p1242295314481">Two tables are joined and the join condition contains non-distribution columns. If the stream operator is disabled, the CN delivers the base table scanning statements to each DN. Then, the JOIN operation is performed on the CN.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_screen42531758124619"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SET</span><span class="w"> </span><span class="n">enable_stream_operator</span><span class="o">=</span><span class="k">off</span><span class="p">;</span>
<span class="k">SET</span><span class="w"> </span><span class="n">explain_perf_mode</span><span class="o">=</span><span class="n">normal</span><span class="p">;</span>
<span class="k">EXPLAIN</span><span class="w"> </span><span class="p">(</span><span class="k">VERBOSE</span><span class="w"> </span><span class="k">on</span><span class="p">,</span><span class="n">COSTS</span><span class="w"> </span><span class="k">off</span><span class="p">)</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">tt01</span><span class="p">,</span><span class="n">tt02</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="o">=</span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">;</span>
<span class="w"> </span><span class="n">QUERY</span><span class="w"> </span><span class="n">PLAN</span>
<span class="c1">-----------------------------------------------------------------------------</span>
<span class="w"> </span><span class="n">Hash</span><span class="w"> </span><span class="k">Join</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c2</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="n">Hash</span><span class="w"> </span><span class="n">Cond</span><span class="p">:</span><span class="w"> </span><span class="p">(</span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">)</span>
<span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="k">Data</span><span class="w"> </span><span class="n">Node</span><span class="w"> </span><span class="n">Scan</span><span class="w"> </span><span class="k">on</span><span class="w"> </span><span class="n">tt01</span><span class="w"> </span><span class="ss">&quot;_REMOTE_TABLE_QUERY_&quot;</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="n">Node</span><span class="o">/</span><span class="n">s</span><span class="p">:</span><span class="w"> </span><span class="k">All</span><span class="w"> </span><span class="n">datanodes</span>
<span class="w"> </span><span class="n">Remote</span><span class="w"> </span><span class="n">query</span><span class="p">:</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="k">ONLY</span><span class="w"> </span><span class="n">dbadmin</span><span class="p">.</span><span class="n">tt01</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="k">true</span>
<span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Hash</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="k">Data</span><span class="w"> </span><span class="n">Node</span><span class="w"> </span><span class="n">Scan</span><span class="w"> </span><span class="k">on</span><span class="w"> </span><span class="n">tt02</span><span class="w"> </span><span class="ss">&quot;_REMOTE_TABLE_QUERY_&quot;</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="n">Node</span><span class="o">/</span><span class="n">s</span><span class="p">:</span><span class="w"> </span><span class="k">All</span><span class="w"> </span><span class="n">datanodes</span>
<span class="w"> </span><span class="n">Remote</span><span class="w"> </span><span class="n">query</span><span class="p">:</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="k">ONLY</span><span class="w"> </span><span class="n">dbadmin</span><span class="p">.</span><span class="n">tt02</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="k">true</span>
<span class="p">(</span><span class="mi">13</span><span class="w"> </span><span class="k">rows</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p6885125513458"><strong id="EN-US_TOPIC_0000001614371009__b773716182466">Type 3: Stream plan, no data exchange between DNs</strong></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p1840463114918">Two tables are joined, and the join condition is the distribution column of each table. DNs do not need to exchange data. After generating a stream plan, the CN delivers the plan except the Gather Stream part to DNs for execution. The CN scans the base table on each DN, performs hash join, and sends the result to the CN.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_screen44313419491"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span>
<span class="normal">21</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SET</span><span class="w"> </span><span class="n">enable_fast_query_shipping</span><span class="o">=</span><span class="k">off</span><span class="p">;</span>
<span class="k">SET</span><span class="w"> </span><span class="n">enable_stream_operator</span><span class="o">=</span><span class="k">on</span><span class="p">;</span>
<span class="k">EXPLAIN</span><span class="w"> </span><span class="p">(</span><span class="k">VERBOSE</span><span class="w"> </span><span class="k">on</span><span class="p">,</span><span class="n">COSTS</span><span class="w"> </span><span class="k">off</span><span class="p">)</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">tt01</span><span class="p">,</span><span class="n">tt02</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="o">=</span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span><span class="p">;</span>
<span class="w"> </span><span class="n">QUERY</span><span class="w"> </span><span class="n">PLAN</span>
<span class="c1">----------------------------------------------------</span>
<span class="w"> </span><span class="n">Streaming</span><span class="w"> </span><span class="p">(</span><span class="k">type</span><span class="p">:</span><span class="w"> </span><span class="n">GATHER</span><span class="p">)</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c2</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="n">Node</span><span class="o">/</span><span class="n">s</span><span class="p">:</span><span class="w"> </span><span class="k">All</span><span class="w"> </span><span class="n">datanodes</span>
<span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Hash</span><span class="w"> </span><span class="k">Join</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c2</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="n">Hash</span><span class="w"> </span><span class="n">Cond</span><span class="p">:</span><span class="w"> </span><span class="p">(</span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span><span class="p">)</span>
<span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Seq</span><span class="w"> </span><span class="n">Scan</span><span class="w"> </span><span class="k">on</span><span class="w"> </span><span class="n">dbadmin</span><span class="p">.</span><span class="n">tt01</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="n">Distribute</span><span class="w"> </span><span class="k">Key</span><span class="p">:</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span>
<span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Hash</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="o">-&gt;</span><span class="w"> </span><span class="n">Seq</span><span class="w"> </span><span class="n">Scan</span><span class="w"> </span><span class="k">on</span><span class="w"> </span><span class="n">dbadmin</span><span class="p">.</span><span class="n">tt02</span>
<span class="w"> </span><span class="k">Output</span><span class="p">:</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c1</span><span class="p">,</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="w"> </span><span class="n">Distribute</span><span class="w"> </span><span class="k">Key</span><span class="p">:</span><span class="w"> </span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span>
<span class="p">(</span><span class="mi">14</span><span class="w"> </span><span class="k">rows</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p16232116124615"><strong id="EN-US_TOPIC_0000001614371009__b1151819353197">Type 4: Stream plan, with data exchange between DNs</strong></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p3751748125915">When two tables are joined and the join condition contains non-distribution columns, and the stream operator is enabled (SET enable_stream_operator=on), a stream plan is generated, which allows data exchange between DNs. For table <strong id="EN-US_TOPIC_0000001614371009__b117421917184317">tt02</strong>, the base table is scanned on each DN. After the scanning, the <strong id="EN-US_TOPIC_0000001614371009__b1483710351208">Redistribute Stream</strong> operator performs hash calculation based on <strong id="EN-US_TOPIC_0000001614371009__b1542418501418">tt02.c1</strong> in the <strong id="EN-US_TOPIC_0000001614371009__b1640313534119">JOIN</strong> condition, sends the hash calculation result to each DN, and then performs JOIN on each DN, finally, the data is summarized to the CN.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p2031525112518"><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_image526615682511" src="figure/en-us_image_0000001566368234.png"></span></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p36401386414"><strong id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_b1491129149">Type 5: Remote-Query plan</strong></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p1254822319410"><strong id="EN-US_TOPIC_0000001614371009__b118091501215">unship_func</strong> cannot be pushed down and does not meet partial pushdown requirements (subquery pushdown). Therefore, you can only send base table scanning statements to DNs and collect base table data to the CN for calculation.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p19834150132610"><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_image349411102612" src="figure/en-us_image_0000001616926901.png"></span></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_p856965652112"><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0000001233563189_image2426135762118" src="figure/en-us_image_0000001616687341.png"></span></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_section125251538325"><h4 class="sectiontitle">EXPLAIN PERFORMANCE Description</h4><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_p15817070">You can use <strong id="EN-US_TOPIC_0000001614371009__b1704235128103342">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000001614371009__b501921988103342">EXPLAIN PERFORMANCE</strong> to check the SQL statement execution information and compare the actual execution and the optimizer's estimation to find what to optimize. <strong id="EN-US_TOPIC_0000001614371009__b881940234103342">EXPLAIN PERFORMANCE</strong> provides the execution information on each DN, whereas <strong id="EN-US_TOPIC_0000001614371009__b2120162543103342">EXPLAIN ANALYZE</strong> does not.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p1118985543216">Tables are defined as follows:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_screen105301814153317"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">tt01</span><span class="p">(</span><span class="n">c1</span><span class="w"> </span><span class="nb">int</span><span class="p">,</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="nb">int</span><span class="p">)</span><span class="w"> </span><span class="n">DISTRIBUTE</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">hash</span><span class="p">(</span><span class="n">c1</span><span class="p">);</span>
<span class="k">CREATE</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">tt02</span><span class="p">(</span><span class="n">c1</span><span class="w"> </span><span class="nb">int</span><span class="p">,</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="nb">int</span><span class="p">)</span><span class="w"> </span><span class="n">DISTRIBUTE</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="n">hash</span><span class="p">(</span><span class="n">c2</span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_p8135907">The following SQL query statement is used as an example:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_s16c34949e08f4aa8b0bc4940b50c38da"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">tt01</span><span class="p">,</span><span class="n">tt02</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">tt01</span><span class="p">.</span><span class="n">c1</span><span class="o">=</span><span class="n">tt02</span><span class="p">.</span><span class="n">c2</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_p55028720">The output of EXPLAIN PERFORMANCE consists of the following parts:</p>
<ol id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_ol64854219"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li13777030193613">Execution Plan<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p5759536193613"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li13777030193613"></a><a name="en-us_topic_0000001610880741_li13777030193613"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image3572195143718" src="figure/en-us_image_0000001564012364.png"></span></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p9152163519369">The plan is displayed as a table, which contains 11 columns: <strong id="EN-US_TOPIC_0000001614371009__b384131046103342">id</strong>, <strong id="EN-US_TOPIC_0000001614371009__b768568249103342">operation</strong>, <strong id="EN-US_TOPIC_0000001614371009__b2123578127103342">A-time</strong>, <strong id="EN-US_TOPIC_0000001614371009__b1062499418103342">A-rows</strong>, <strong id="EN-US_TOPIC_0000001614371009__b57804345103342">E-rows</strong>, <strong id="EN-US_TOPIC_0000001614371009__b1429616461103342">E-distinct</strong>, <strong id="EN-US_TOPIC_0000001614371009__b840574375103342">Peak Memory</strong>, <strong id="EN-US_TOPIC_0000001614371009__b779116826103342">E-memory</strong>, <strong id="EN-US_TOPIC_0000001614371009__b1033955619103342">A-width</strong>, <strong id="EN-US_TOPIC_0000001614371009__b1497902469103342">E-width</strong>, and <strong id="EN-US_TOPIC_0000001614371009__b974920726103342">E-costs</strong>. <a href="#EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_table94981536102">Table 1</a> describes the meanings of the columns.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_table94981536102"></a><a name="en-us_topic_0000001610880741_table94981536102"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_table94981536102" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Execution column description</caption><thead align="left"><tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row2049925391019"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.6.8.1.3.2.3.1.1"><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p549910534107">Column</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="80%" id="mcps1.3.6.8.1.3.2.3.1.2"><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p94998536109">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row114991353111017"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p10499853161014">id</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p19499253151014">ID of an execution operator.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row1949925315106"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p15499115321016">operation</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p2422540161118">Name of an execution operator.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p15383517114">The operator of the Vector prefix refers to a vectorized execution engine operator, which exists in a query containing a column-store table.</p>
<div class="p" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p35311356115">Streaming is a special operator. It implements the core data shuffle function of the distributed architecture. Streaming has three types, which correspond to different data shuffle functions in the distributed architecture: <ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ul1653123513115"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li7532035171112">Streaming (type: GATHER): The CN collects data from DNs.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li553153514114">Streaming(type: REDISTRIBUTE): Data is redistributed to all the DNs based on selected columns.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li5531135111111">Streaming(type: BROADCAST): Data on the current DN is broadcast to all other DNs.</li></ul>
</div>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row134993533104"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p550019535107">A-time</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p1852446121213">Execution time of an operator on each DN. Generally, A-time of an operator is two values enclosed by square brackets ([]), indicating the shortest and longest time for completing the operator on all DNs, including the execution time of the lower-layer operators.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p18307139126">Note: In the entire plan, the execution time of a leaf node is the execution time of the operator, while the execution time of other operators includes the execution time of its subnodes.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row2500953121011"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p2050075381010">A-rows</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p15001553111012">Actual rows output by an operator.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row9500105310100"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p13500853151017">E-rows</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p1650018531107">Estimated rows output by each operator.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row450095313102"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p4500205311102">E-distinct</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p550085381020">Estimated distinct value of the hashjoin operator.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row175001053131012"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p95001153191016">Peak Memory</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p350065321011">Peak memory used when the operator is executed on each DN. The left value in [] is the minimum value, and the right value in [] is the maximum value.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row8664038171314"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p5664183811136">E-memory</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p186658383132">Estimated memory used by each operator on a DN. Only operators executed on DNs are displayed. In certain scenarios, the memory upper limit enclosed in parentheses will be displayed following the estimated memory usage.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row13421344181315"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p8439440130">A-width</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p943174412136">The actual width of each line of tuple of the current operator. This parameter is valid only for the heavy memory operator is displayed, including: (Vec)HashJoin, (Vec)HashAgg, (Vec) HashSetOp, (Vec)Sort, and (Vec)Materialize operator. The (Vec)HashJoin calculation of width is the width of the right subtree operator, it will be displayed in the right subtree.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row14365173521319"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p183651935161313">E-width</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p11366163516132">Estimated width of the output tuple of each operator.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_row189723351519"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.6.8.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p88971332155">E-costs</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.6.8.1.3.2.3.1.2 "><div class="p" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p965717474153">Estimated execution cost of each operator.<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ul289510458153"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li1289515450156">E-costs are defined by the optimizer based on cost parameters, habitually grasping disk page as a unit. Other overhead parameters are set by referring to E-costs.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li1289594561510">The cost of each node (the E-costs value) includes the cost of all of its child nodes.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li1895245131513">Overhead reflects only what the optimizer is concerned about, but does not consider the time that the result row passed to the client. Although the time may play a very important role in the actual total time, it is ignored by the optimizer, because it cannot be changed by modifying the plan.</li></ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li8985936333">SQL Diagnostic Information<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p81324535312"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li8985936333"></a><a name="en-us_topic_0000001610880741_li8985936333"></a>SQL self-diagnosis information. Performance optimization points identified during optimization and execution are displayed. When <strong id="EN-US_TOPIC_0000001614371009__b871286522103342">EXPLAIN</strong> with the <strong id="EN-US_TOPIC_0000001614371009__b311354258103342">VERBOSE</strong> attribute (built-in <strong id="EN-US_TOPIC_0000001614371009__b719513099103342">VERBOSE</strong> of <strong id="EN-US_TOPIC_0000001614371009__b1302960795103342">EXPLAIN PERFORMANCE</strong>) is executed on DML statements, SQL self-diagnosis information is also generated to help locate performance issues.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_li35632012">Predicate Information (identified by plan id)<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p6160145514517"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_li35632012"></a><a name="en-us_topic_0000001610880741_en-us_topic_0073548188_li35632012"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image111593562056" src="figure/en-us_image_0000001563853052.png"></span></p>
<p class="litext" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_p52252659">This part displays the filtering conditions of the corresponding execution operator node, that is, the information that does not change during the entire plan execution, mainly the join conditions and filter information.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_li511887">Memory Information (identified by plan id)<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p46924591565"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_li511887"></a><a name="en-us_topic_0000001610880741_en-us_topic_0073548188_li511887"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image20319101976" src="figure/en-us_image_0000001564171976.png"></span></p>
<p class="litext" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_p4606985">Memory Usage displays the memory usage of operators in the entire plan, mainly Hash and Sort operators, including the peak memory of operators (Peak Memory), memory estimated by the optimizer (Estimate Memory), and control memory (Control Memory), estimated memory usage (operator memory), actual width during execution (Width), number of automatic memory expansion times (Auto Spread Num), whether to spill data to disks in advance (Early Spilled), and spill information which includes the number of repeated data spills (Spill Time(s)), number of internal and foreign table partitions spilled to disks (inner/outer partition spill num), number of files spilled to disks (temp file num), amount of data spilled to disks, and amount of data flushed to the minimum and maximum partitions (written disk IO [min, max]). The Sort operator does not display the number of files written to disks, and displays disks only when displaying sorting methods.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li277894310493">Targetlist Information (identified by plan id)<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p111562351399"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li277894310493"></a><a name="en-us_topic_0000001610880741_li277894310493"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image33371361397" src="figure/en-us_image_0000001564331880.png"></span></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p339115524916">This part displays the output target column information of each operator.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_li41462866">DataNode Information (identified by plan id)<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p078918014108"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_li41462866"></a><a name="en-us_topic_0000001610880741_en-us_topic_0073548188_li41462866"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image4320162131011" src="figure/en-us_image_0000001614371749.png"></span></p>
<p class="litext" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_p37621475">This part displays the execution time of each operator (including the execution time of filtering and projection, if any), CPU usage, and buffer usage.</p>
<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ul18762510156"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li39991811172212">Operator execution information<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p19922134517239"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li39991811172212"></a><a name="en-us_topic_0000001610880741_li39991811172212"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image976454632316" src="figure/en-us_image_0000001614252121.png"></span></p>
<div class="p" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p97105238243">The execution information of each operator consists of three parts:<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ul164942441233"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li1949464422312"><strong id="EN-US_TOPIC_0000001614371009__b7553182274014">dn_6001_6002</strong>/<strong id="EN-US_TOPIC_0000001614371009__b863215256408">dn_6003_6004</strong> indicates the information about the execution node. The information in the brackets is the actual execution information.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li174941944192312"><strong id="EN-US_TOPIC_0000001614371009__b1241165510425">actual time</strong> indicates the actual execution time. The first number indicates the duration from the time when the operator is executed to the time when the first data record is output. The second number indicates the total execution time of all data records.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li849418443238"><strong id="EN-US_TOPIC_0000001614371009__b15414329431">rows</strong> indicates the number of output data rows of the operator.</li></ul>
<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ul104952447231"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li10495174422312"><strong id="EN-US_TOPIC_0000001614371009__b199244434310">loops</strong> indicates the number of execution times of the operator. Note that for a partitioned table, scan on each partition is counted as a scan. Scan on a new partition is counted as a new scan.</li></ul>
</div>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li17124103372210">CPU information<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p18541414152314"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li17124103372210"></a><a name="en-us_topic_0000001610880741_li17124103372210"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image5483181512233" src="figure/en-us_image_0000001614452197.png"></span></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p1263218129231">Each operator execution process has CPU information. <strong id="EN-US_TOPIC_0000001614371009__b3952102804711">cyc</strong> indicates the number of CPU cycles, and <strong id="EN-US_TOPIC_0000001614371009__b179742334471">ex cyc</strong> indicates the number of cycles of the current operator, excluding its subnodes. <strong id="EN-US_TOPIC_0000001614371009__b273415398474">inc cyc</strong> indicates the number of cycles, including subnodes, <strong id="EN-US_TOPIC_0000001614371009__b688704724714">ex row</strong> indicates the number of data rows output by the current operator, and <strong id="EN-US_TOPIC_0000001614371009__b1182135764711">ex c/r</strong> indicates the mean of <strong id="EN-US_TOPIC_0000001614371009__b1280013719485">ex cyc</strong> and <strong id="EN-US_TOPIC_0000001614371009__b653651774820">ex row</strong>.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li941929112416">Buffer information<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p174871825132513"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li941929112416"></a><a name="en-us_topic_0000001610880741_li941929112416"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image8708184213256" src="figure/en-us_image_0000001614571749.png"></span></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p7771321102511"><strong id="EN-US_TOPIC_0000001614371009__b1042361175016">Buffers</strong> indicates the buffer information, including the read and write operations on shared blocks and temporary blocks.</p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p1177112122519">Shared blocks contain tables and indexes, and temporary blocks are disk blocks used in sorting and materialization. The number of blocks displayed on the upper-layer node contains the number of blocks used by all its subnodes.</p>
</li></ul>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li201712497517">User Define Profiling<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p1374762461012"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li201712497517"></a><a name="en-us_topic_0000001610880741_li201712497517"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image14814626161019" src="figure/en-us_image_0000001564012372.png"></span></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p775114012520">User-defined information, including the time when CNs and DNs are connected, the time when DNs are connected, and some execution information at the storage layer.</p>
</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_li3048957">Query Summary<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_p66961823161213"><a name="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_li3048957"></a><a name="en-us_topic_0000001610880741_en-us_topic_0073548188_li3048957"></a><span><img id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_image174976254123" src="figure/en-us_image_0000001563853056.png"></span></p>
<p id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_en-us_topic_0073548188_p27440617">The total execution time and network traffic, including the maximum and minimum execution time in the initialization and end phases on each DN, initialization, execution, and time in the end phase on each CN, and the system available memory during the current statement execution, and statement estimation memory information.</p>
<ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ul386435201818"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li1986485161810">DataNode executor start time: start time of the DN executor. The format is [min_node_name, max_node_name]: [min_time, max_time].</li><li id="EN-US_TOPIC_0000001614371009__li12880142541615">DataNode executor run time: running time of the DN executor. The format is [min_node_name, max_node_name]: [min_time, max_time].</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li208648561810">DataNode executor end time: end time of the DN executor. The format is [min_node_name, max_node_name]: [min_time, max_time].</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li1286412551813"><strong id="EN-US_TOPIC_0000001614371009__b10684811155314">Remote query poll time</strong>: poll waiting time for receiving results</li><li id="EN-US_TOPIC_0000001614371009__li1197919515179">System available mem: available system memory</li><li id="EN-US_TOPIC_0000001614371009__li197841338151914">Query Max mem: maximum query memory.</li><li id="EN-US_TOPIC_0000001614371009__li19614185813196">Enqueue time: enqueuing time</li><li id="EN-US_TOPIC_0000001614371009__li564452442113">Coordinator executor start time: start time of the CN executor</li><li id="EN-US_TOPIC_0000001614371009__li295777162417">Coordinator executor run time: CN executor running time</li><li id="EN-US_TOPIC_0000001614371009__li5421459132613">Coordinator executor end time: end time of the CN executor</li><li id="EN-US_TOPIC_0000001614371009__li6888420132712">Parser runtime: parser running time</li><li id="EN-US_TOPIC_0000001614371009__li125759235289">Planner runtime: optimizer execution time</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li9864750182">Network traffic, or, the amount of data sent by the stream operator</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li13864195121815">Query Id: query ID.</li><li id="EN-US_TOPIC_0000001614371009__li1641625123914">Unique SQL ID: constraint SQL ID</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li19865105161816">Total runtime: total execution time</li></ul>
</li></ol>
<div class="notice" id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_note2968182711352"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_ul19632205362"><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li166322001368">The difference between A-rows and E-rows shows the deviation between the optimizer estimation and actual execution. Generally, if the deviation is large, the plan generated by the optimizer cannot be trusted, and you need to modify the deviation value.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li16632190163618">If the difference of the A-time values is large, it indicates that the operator computing skew (difference between execution time on DNs) is large and that manual performance tuning is required. Generally, for two adjacent operators, the execution time of the upper-layer operator includes that of the lower-layer operator. However, if the upper-layer operator is a stream operator, its execution time may be less than that of the lower-layer operator, as there is no driving relationship between threads.</li><li id="EN-US_TOPIC_0000001614371009__en-us_topic_0000001610880741_li463217013369"><strong id="EN-US_TOPIC_0000001614371009__b1392308743103342">Max Query Peak Memory</strong> is often used to estimate the consumed memory of SQL statements, and is also used as an important basis for setting a memory parameter during SQL statement optimization. Generally, the output from <strong id="EN-US_TOPIC_0000001614371009__b130894782103342">EXPLAIN ANALYZE</strong> or <strong id="EN-US_TOPIC_0000001614371009__b1953876871103342">EXPLAIN PERFORMANCE</strong> is provided for the input for further optimization.</li></ul>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0400.html">Performance Tuning</a></div>
</div>
</div>