{"id":13366,"date":"2026-05-18T11:06:00","date_gmt":"2026-05-18T03:06:00","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=13366"},"modified":"2026-05-18T11:19:55","modified_gmt":"2026-05-18T03:19:55","slug":"gbase-8a%e9%9b%86%e7%be%a4%e8%bf%90%e7%bb%b4%ef%bc%8c%e5%8f%82%e6%95%b0%e8%b0%83%e6%95%b4%e5%bc%95%e5%8f%91%e6%80%a7%e8%83%bd%e5%bc%82%e5%b8%b8%e7%9a%84%e6%8e%92%e6%9f%a5%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/13366","title":{"rendered":"GBase 8a Cluster Operations and Maintenance: Troubleshooting and Analysis of Performance Anomalies"},"content":{"rendered":"<p>This article introduces a case where parameter adjustments made for business needs led to performance anomalies in other business areas. It includes the investigation and analysis processes.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2a944fe8028\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2a944fe8028\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E7%8E%B0%E8%B1%A1\" >Phenomenon<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%8E%92%E6%9F%A5\" >Troubleshoot<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E9%9B%86%E7%BE%A4%E8%BF%90%E8%A1%8C%E7%9A%84SQL\" >View SQL running on the cluster<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E8%AE%A1%E7%AE%97%E8%8A%82%E7%82%B9SQL\" >View Compute Node SQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E7%99%BB%E5%BD%95node3%E6%9F%A5%E7%9C%8B%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E7%8E%AF%E5%A2%83%E6%8A%A5%E9%94%99\" >Log in to node3 and check for environmental errors.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%BF%97\" >View operating system logs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E5%86%85%E5%AD%98\" >View memory<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E7%B3%BB%E7%BB%9F%E8%B5%84%E6%BA%90%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E6%8C%81%E7%BB%AD%E7%B9%81%E5%BF%99\" >Check if system resources are continuously busy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E7%94%A8%E6%88%B7%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9B%91%E6%8E%A7%E5%8E%86%E5%8F%B2\" >View user operating system monitoring history<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%B4%E6%97%B6%E7%9B%AE%E5%BD%95\" >View database temp directory<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E4%B8%9A%E5%8A%A1SQL%E6%80%A7%E8%83%BD%E6%8E%92%E6%9F%A5\" >Business SQL Performance Troubleshooting<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E7%A1%AE%E8%AE%A4%E4%B8%9A%E5%8A%A1SQL\" >Confirm business SQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E9%80%90%E5%B1%82%E7%A1%AE%E8%AE%A4%E4%B8%89%E4%B8%AAjoin%E8%A1%A8%E7%9A%84%E8%A1%8C%E6%95%B0\" >Confirm the row count of three joined tables layer by layer.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E9%80%90%E4%B8%AA%E7%A1%AE%E8%AE%A4%E6%9C%80%E7%BB%88%E7%BB%93%E6%9E%9C%E9%9B%86%E8%A1%8C%E6%95%B0\" >Confirm the number of final result set rows one by one<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E7%A1%AE%E8%AE%A4%E5%93%AA%E4%B8%AA%E6%8A%95%E5%BD%B1%E5%88%97%E5%AF%BC%E8%87%B4%E4%BA%86%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98\" >Confirm which projection columns are causing performance issues<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E4%B8%B4%E6%97%B6%E8%A1%A8%E7%BB%93%E6%9E%84\" >Check temporary table structure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E5%8E%9F%E5%A7%8BSQL\" >View original SQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%9F%A5%E7%9C%8B%E6%95%B0%E6%8D%AE%E5%BA%93%E5%8F%82%E6%95%B0\" >View database parameters<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E5%88%86%E6%9E%90\" >Analyse<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E5%8F%82%E6%95%B0%E7%94%B1%E6%9D%A5\" >Parameter origin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#longblob%E7%B1%BB%E5%9E%8B%E7%94%B1%E6%9D%A5\" >Origin of LONGBLOB type<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%8E%92%E5%BA%8F%E7%9A%84%E7%A3%81%E7%9B%98%E5%8D%A0%E7%94%A8%E5%8E%9F%E5%9B%A0\" >Sorted disk usage reasons<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E4%B8%BA%E4%BB%80%E4%B9%88%E5%8F%AA%E6%9C%89node3%E4%B8%8A%E6%9C%89%E8%BF%99%E4%B9%88%E5%A4%A7%E7%9A%84%E4%B8%B4%E6%97%B6%E6%96%87%E4%BB%B6\" >Why is there such a large temporary file only on node3?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E5%8F%82%E6%95%B0%E8%83%BD%E8%B0%83%E6%95%B4%E5%90%97%EF%BC%9F\" >Can the parameters be adjusted?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88\" >Solution<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E8%B0%83%E6%95%B4SQL\" >Adjust SQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E4%BD%BF%E7%94%A8hint\" >Use hint<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E5%8D%87%E7%BA%A795%E7%89%88%E6%9C%AC\" >Upgrade to version 95<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/www.gbase8.cn\/en\/13366\/#%E6%80%BB%E7%BB%93\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%8E%B0%E8%B1%A1\"><\/span>Phenomenon<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The on-site feedback is that an SQL query has been running for over three hours and has not finished. At the same time, multiple SQL queries in the cluster are taking much longer than usual to complete.<\/p>\n\n\n\n<p>The current cluster is version 862. We are preparing to upgrade to version 953. Due to this issue, the customer is requesting an analysis of the cause and whether this issue also exists in version 953.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%8E%92%E6%9F%A5\"><\/span>Troubleshoot<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E9%9B%86%E7%BE%A4%E8%BF%90%E8%A1%8C%E7%9A%84SQL\"><\/span>View SQL running on the cluster<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The longest run is 12,000 seconds, which is over 3 hours. There's another one after it with over 10,000 seconds. The SQL looks like users are executing it repeatedly.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>SELECT COORDINATOR_NAME, ID, user, host, command, start_time, time, state, SUBSTRING(info, 0, 100) AS info FROM information_schema.COORDINATORS_TASK_INFORMATION WHERE command = 'query' AND time &gt;= 0 ORDER BY time DESC LIMIT 10;<\/code><\/pre>\n\n\n\n<p>The SQL started executing at 20:14:05.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"228\" src=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-1-1024x228.png\" alt=\"\" class=\"wp-image-13375\" srcset=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-1-1024x228.png 1024w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-1-600x134.png 600w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-1-300x67.png 300w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-1-768x171.png 768w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-1.png 1199w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E8%AE%A1%E7%AE%97%E8%8A%82%E7%82%B9SQL\"><\/span>View Compute Node SQL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The compute node execution time is 12000 seconds, which corresponds to the cluster layer. Additionally, all SQL statements are on node3, indicating that this node is the cause of the problem.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>SELECT NODE_NAME, ID, user, host, command, start_time, time, state, SUBSTRING(info, 0, 100) AS info FROM information_schema.GNODES_TASK_INFORMATION where command=&#x27;query&#x27; and info is not null and info is not like &#x27;%information_schema.processlist%&#x27; order by time desc limit 10;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"239\" src=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-2-1024x239.png\" alt=\"\" class=\"wp-image-13376\" srcset=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-2-1024x239.png 1024w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-2-600x140.png 600w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-2-300x70.png 300w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-2-768x179.png 768w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-2.png 1143w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%99%BB%E5%BD%95node3%E6%9F%A5%E7%9C%8B%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E7%8E%AF%E5%A2%83%E6%8A%A5%E9%94%99\"><\/span>Log in to node3 and check for environmental errors.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>No environment errors were found.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>dmesg | grep -i error<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"540\" height=\"117\" src=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-3.png\" alt=\"\" class=\"wp-image-13377\" srcset=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-3.png 540w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-3-300x65.png 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%BF%97\"><\/span>View operating system logs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Indeed, it's normal; no hardware or operating system error messages were observed.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>tail \/var\/log\/messages<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"502\" src=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-5-1024x502.png\" alt=\"\" class=\"wp-image-13379\" srcset=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-5-1024x502.png 1024w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-5-600x294.png 600w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-5-300x147.png 300w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-5-768x377.png 768w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-5.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%86%85%E5%AD%98\"><\/span>View memory<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Memory is sufficient, no swap is being used.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>free -g<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"654\" height=\"100\" src=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-6.png\" alt=\"\" class=\"wp-image-13381\" srcset=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-6.png 654w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-6-600x92.png 600w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-6-300x46.png 300w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E7%B3%BB%E7%BB%9F%E8%B5%84%E6%BA%90%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E6%8C%81%E7%BB%AD%E7%B9%81%E5%BF%99\"><\/span>Check if system resources are continuously busy<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>As can be seen, the disk remains consistently busy at 1001 TP3T, with a write rate of 900 MB\/s, indicating an extremely high volume of sustained writes.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>iostat -xdc 1<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"605\" src=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-4-1024x605.png\" alt=\"\" class=\"wp-image-13378\" srcset=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-4-1024x605.png 1024w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-4-600x354.png 600w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-4-300x177.png 300w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-4-768x453.png 768w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-4.png 1057w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E7%94%A8%E6%88%B7%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9B%91%E6%8E%A7%E5%8E%86%E5%8F%B2\"><\/span>View user operating system monitoring history<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>After 8 PM, there was a sudden increase in disk usage that has continued until now. This time corresponds with when the SQL started executing.<\/p>\n\n\n\n<p>The following are OS resource monitoring records.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"506\" src=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-7-1024x506.png\" alt=\"\" class=\"wp-image-13382\" srcset=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-7-1024x506.png 1024w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-7-600x296.png 600w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-7-300x148.png 300w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-7-768x379.png 768w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-7.png 1029w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%B4%E6%97%B6%E7%9B%AE%E5%BD%95\"><\/span>View database temp directory<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Discovered thousands of temporary files, type SRT, used for sorting. File size 10TB+.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>du -sh \/gnode\/tmpdata\/*<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"974\" height=\"577\" src=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-8.png\" alt=\"\" class=\"wp-image-13383\" srcset=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-8.png 974w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-8-600x355.png 600w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-8-300x178.png 300w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-8-768x455.png 768w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"261\" src=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-9.png\" alt=\"\" class=\"wp-image-13384\" srcset=\"https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-9.png 718w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-9-600x218.png 600w, https:\/\/www.gbase8.cn\/wp-content\/uploads\/2026\/05\/image-9-300x109.png 300w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%B8%9A%E5%8A%A1SQL%E6%80%A7%E8%83%BD%E6%8E%92%E6%9F%A5\"><\/span>Business SQL Performance Troubleshooting<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%A1%AE%E8%AE%A4%E4%B8%9A%E5%8A%A1SQL\"><\/span>Confirm business SQL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A simple TOP N SQL query with ORDER BY and LIMIT 1000 rows, without an outer GROUP BY clause.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>SELECT\nxxxx\nFROM (\n ...\n)a\nLEFT JOIN (\n  ...\n)b ON ...\nLEFT JOIN (\n  ...\n)c ON ...\nORDER BY xxx\nLIMIT 1000<\/code><\/pre>\n\n\n\n<p>Inside is a left join of 3 subqueries.,<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%90%E5%B1%82%E7%A1%AE%E8%AE%A4%E4%B8%89%E4%B8%AAjoin%E8%A1%A8%E7%9A%84%E8%A1%8C%E6%95%B0\"><\/span>Confirm the row count of three joined tables layer by layer.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Three temporary tables were created using the `CREATE TABLE tmp_a AS SELECT ...` method for three subqueries respectively.<\/p>\n\n\n\n<p>The first subquery is grouped by the main table, with 2 billion rows, resulting in 200,000 rows.<\/p>\n\n\n\n<p>The second subquery is a dimension table with distinct values and returns 2000 rows.<\/p>\n\n\n\n<p>The third subquery is a two-table left join with a group by, and its result set is also 20,000 rows.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%90%E4%B8%AA%E7%A1%AE%E8%AE%A4%E6%9C%80%E7%BB%88%E7%BB%93%E6%9E%9C%E9%9B%86%E8%A1%8C%E6%95%B0\"><\/span>Confirm the number of final result set rows one by one<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Simplify SQL, remove all unnecessary projection columns, and directly count(*)<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>SELECT\n  COUNT(*)\nFROM a\nLEFT JOIN\nb ON ... \n<\/code><\/pre>\n\n\n\n<p>The first left join result set has 200K rows and took less than 10 seconds, with no Cartesian product occurring.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>SELECT\n  COUNT(*)\nFROM a\nLEFT JOIN b ON ...\nLEFT JOIN c ON <\/code><\/pre>\n\n\n\n<p>The second left join result set is still 200,000 rows and takes less than 10 seconds.<\/p>\n\n\n\n<p>In other words, this SQL is not caused by sorting large result sets. Then why does sorting 200,000 rows, especially with a LIMIT clause, generate so much SRT intermediate data?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%A1%AE%E8%AE%A4%E5%93%AA%E4%B8%AA%E6%8A%95%E5%BD%B1%E5%88%97%E5%AF%BC%E8%87%B4%E4%BA%86%E6%80%A7%E8%83%BD%E9%97%AE%E9%A2%98\"><\/span>Confirm which projection columns are causing performance issues<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>When changing `count(*)` back to the original SQL statement one by one, a problem occurred when a column in a temporary C table was involved.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E4%B8%B4%E6%97%B6%E8%A1%A8%E7%BB%93%E6%9E%84\"><\/span>Check temporary table structure<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Check the table structure of temporary table C, and it is found that the column is of type longtext.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E5%8E%9F%E5%A7%8BSQL\"><\/span>View original SQL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Found the column of temporary table C. The calculation is `group_concat(xxx)`, which means converting rows into columns. <\/p>\n\n\n\n<p>Query max(length(xxx)), the original column values in the table only have a maximum of 10 characters, why is the generated intermediate table longtext?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B%E6%95%B0%E6%8D%AE%E5%BA%93%E5%8F%82%E6%95%B0\"><\/span>View database parameters<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>show variables like &#x27;%group_concat_max_len%&#x27;'<\/code><\/pre>\n\n\n\n<p>The return value is 1M, not the default 32K.<\/p>\n\n\n\n<p>Problem identification<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%88%86%E6%9E%90\"><\/span>Analyse<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E6%95%B0%E7%94%B1%E6%9D%A5\"><\/span>Parameter origin<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The execution result of group_concat is 32K by default (corresponding to 10922 characters in the utf8 character set). If the execution result exceeds 32K, an error will occur (Aggregation function&nbsp;<mark>GROUP_CONCAT<\/mark>&nbsp;overflow<\/p>\n\n\n\n<p>Please refer to the following article:<a href=\"https:\/\/www.gbase8.cn\/en\/396\/?hilite=group_concat\">Common Errors in Nanda Tongyong GBase 8a Clusters: Aggregation Function&nbsp;<mark>GROUP_CONCAT<\/mark>&nbsp;overflow<\/a><\/p>\n\n\n\n<p>To solve this problem, the database added a parameter `group_concat_max_len`, which is the maximum length allowed for this function. The user set it to 1MB.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"longblob%E7%B1%BB%E5%9E%8B%E7%94%B1%E6%9D%A5\"><\/span>Origin of LONGBLOB type<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you want to save the direct result into a [temporary intermediate table], similar to `create table tmpXXX as select`, you need to [pre-evaluate] the column width; you cannot create the table after execution. The parameter value for that column is 1M, which exceeds the maximum allowed by `varchar` (32K), so the field type was evaluated as `longtext`.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%8E%92%E5%BA%8F%E7%9A%84%E7%A3%81%E7%9B%98%E5%8D%A0%E7%94%A8%E5%8E%9F%E5%9B%A0\"><\/span>Sorted disk usage reasons<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>When sorting, the projection columns involved in the sort must be materialized first.<\/p>\n\n\n\n<p>Data requires pre-allocated memory to store materialized data. In version 862, memory was allocated based on the table structure. The maximum length of longtext is 64MB, which is insufficient memory, so it was written to a temporary file on disk.<\/p>\n\n\n\n<p>200,000 lines, with each line being at least 64MB, multiply to 12.2TB. As a result, temporary files totaling over 10TB were written to disk. At a write speed of 1GB per second, this would still take 3.4 hours.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%B8%BA%E4%BB%80%E4%B9%88%E5%8F%AA%E6%9C%89node3%E4%B8%8A%E6%9C%89%E8%BF%99%E4%B9%88%E5%A4%A7%E7%9A%84%E4%B8%B4%E6%97%B6%E6%96%87%E4%BB%B6\"><\/span>Why is there such a large temporary file only on node3?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>View the main table SQL, which includes `group by clttime`, `cell_id`. `cell_id` is the cellular cell number and is relatively numerous. `clttime` is the collection date and is a single value for the day. This table is also a random distribution table without a hash column. Therefore, during the `group by` operation, the first column is selected as the distribution column, and all data falls onto a single node.<\/p>\n\n\n\n<p>You can place the cell_id column first here to avoid this situation.<\/p>\n\n\n\n<p>Or use all group by columns together as hash distribution columns, but this will affect performance. The parameter is<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>t_gcluster_hash_redistribute_groupby_on_multiple_expression<\/code><\/pre>\n\n\n\n<p>Reference:<a href=\"https:\/\/www.gbase8.cn\/en\/3737\/?hilite=group+%E5%A4%9A%E5%88%97\">Namalla General GBase 8a distinct<mark>Group<\/mark>Avoid performance issues caused by severe data skew during joins<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E6%95%B0%E8%83%BD%E8%B0%83%E6%95%B4%E5%90%97%EF%BC%9F\"><\/span>Can the parameters be adjusted?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>This parameter was increased because other businesses did indeed have group_concat results exceeding 32K, but it caused other SQL statements to execute abnormally under this parameter. From a global parameter perspective, there is only one parameter value, which cannot perfectly match all scenarios.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88\"><\/span>Solution<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%B0%83%E6%95%B4SQL\"><\/span>Adjust SQL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Intervene in the execution result width evaluation of group_concat, for example, by wrapping it with substr.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>substr(group_concat(xxx),0,1000)<\/code><\/pre>\n\n\n\n<p>This way, the resulting width will not exceed 1000 characters, and the column type for the intermediate table will be varchar(1000).<\/p>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color has-link-color wp-elements-6d94d9d4953354922218573b1f2a8208\"><strong>The proposed solution was implemented on-site and completed in under 30 seconds.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8hint\"><\/span>Use hint<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>gbase 8a can dynamically adjust session-level parameter values through hints, for example<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>select \/*+group_concat_max_len(3000)*\/ ...<\/code><\/pre>\n\n\n\n<p>This hint specifies that the maximum `group_concat` width for this SQL will not exceed 3000 bytes, which is equivalent to 1000 UTF-8 characters.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8D%87%E7%BA%A795%E7%89%88%E6%9C%AC\"><\/span>Upgrade to version 95<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In version 95, memory allocation is not based on the maximum width of fields. Instead, a block of memory is allocated based on the current data, and if it's insufficient, more memory is continuously allocated. This reduces the actual memory footprint, and the corresponding intermediate result sets more closely resemble actual disk usage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%80%BB%E7%BB%93\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Due to parameter adjustments, the database memory evaluation was large, writing a large number of intermediate disk files for sorting. This caused the node's IO resources to be continuously busy, leading to a performance degradation of other normal SQL operations.<\/p>\n\n\n\n<p>At the same time, one parameter cannot adapt to all scenarios, and some important business SQLs can use hints to set their own suitable parameters.<\/p>","protected":false},"excerpt":{"rendered":"<p>This article introduces a case where parameter adjustments made for business needs led to performance anomalies in other business areas. It includes the investigation and analysis processes.<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[28],"class_list":["post-13366","post","type-post","status-publish","format-standard","hentry","category-gbase8a","tag-28"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/13366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=13366"}],"version-history":[{"count":19,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/13366\/revisions"}],"predecessor-version":[{"id":13402,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/13366\/revisions\/13402"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=13366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=13366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=13366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}