This is an automated email from the ASF dual-hosted git repository.

luzhijing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new da74ce58b80c update show data skew doc (#496)
da74ce58b80c is described below

commit da74ce58b80c67dfb32c976a66213cd56e21b482
Author: dongsilun <70750474+dongsi...@users.noreply.github.com>
AuthorDate: Tue Apr 2 15:13:55 2024 +0800

    update show data skew doc (#496)
---
 .../Show-Statements/SHOW-DATA-SKEW.md              | 123 +++++++++++++++++++--
 .../Show-Statements/SHOW-DATA-SKEW.md              | 119 ++++++++++++++++++--
 2 files changed, 224 insertions(+), 18 deletions(-)

diff --git a/docs/sql-manual/sql-reference/Show-Statements/SHOW-DATA-SKEW.md 
b/docs/sql-manual/sql-reference/Show-Statements/SHOW-DATA-SKEW.md
index c54587eb7283..e8938478e113 100644
--- a/docs/sql-manual/sql-reference/Show-Statements/SHOW-DATA-SKEW.md
+++ b/docs/sql-manual/sql-reference/Show-Statements/SHOW-DATA-SKEW.md
@@ -32,25 +32,128 @@ SHOW DATA SKEW
 
 ### Description
 
-    This statement is used to view the data skew of a table or a partition.
+    This statement is used to view the data skew of a table or the specified 
partitions.
 
     grammar:
 
-        SHOW DATA SKEW FROM [db_name.]tbl_name [PARTITION (p1)];
+        SHOW DATA SKEW FROM [db_name.]tbl_name [PARTITION (partition_name, 
...)];
 
-       Description:
+    Description:
 
-               1. Only one partition must be specified. For non-partitioned 
tables, the partition name is the same as the table name.
-               2. The result will show row count and data volume of each 
bucket under the specified partition, and the proportion of the data volume of 
each bucket in the total data volume.
+        1. The result will show row count and data volume of each bucket under 
the specified partition, and the proportion of the data volume of each bucket 
in the total data volume.
+        2. For non-partitioned tables, the partition name in result is the 
same as the table name.
 
 ### Example
-
-    1. View the data skew of the table
-
-        SHOW DATA SKEW FROM db1.test PARTITION(p1);
+1. For partitioned tables
+
+* CREATE-TABLE
+    ```sql
+    CREATE TABLE test_show_data_skew
+    (
+      id int, 
+      name string, 
+      pdate date
+    ) 
+    PARTITION BY RANGE(pdate) 
+    (
+      FROM ("2023-04-16") TO ("2023-04-20") INTERVAL 1 DAY
+    ) 
+    DISTRIBUTED BY HASH(id) BUCKETS 5
+    PROPERTIES (
+      "replication_num" = "1"
+    );
+    ```
+* View the data skew of the table
+   ```sql
+    mysql> SHOW DATA SKEW FROM test_show_data_skew;
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    | PartitionName | BucketIdx | AvgRowCount | AvgDataSize | Graph            
                                                                                
    | Percent |
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    | p_20230416    | 0         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                               
                     | 49.77 % |
+    | p_20230416    | 1         | 2           | 654         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                              
                     | 50.23 % |
+    | p_20230416    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230416    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230416    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 0         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 1         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 4         | 2           | 656         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 | 100.00% |
+    | p_20230418    | 0         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 1         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 | 100.00% |
+    | p_20230418    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230419    | 0         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230419    | 1         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                               
                     | 49.96 % |
+    | p_20230419    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230419    | 3         | 1           | 649         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                              
                     | 50.04 % |
+    | p_20230419    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    ```
+* View the data skew of the specified partitions.
+    ```sql
+    mysql> SHOW DATA SKEW FROM test_show_data_skew PARTITION(p_20230416, 
p_20230418);
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    | PartitionName | BucketIdx | AvgRowCount | AvgDataSize | Graph            
                                                                                
    | Percent |
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    | p_20230416    | 0         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                               
                     | 49.77 % |
+    | p_20230416    | 1         | 2           | 654         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                              
                     | 50.23 % |
+    | p_20230416    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230416    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230416    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 0         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 1         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 | 100.00% |
+    | p_20230418    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    ```
+
+2. For non-partitioned tables
+
+* CREATE-TABLE
+    ```sql
+    CREATE TABLE test_show_data_skew2
+    (
+        id int, 
+        name string, 
+        pdate date
+    ) 
+    DISTRIBUTED BY HASH(id) BUCKETS 5
+    PROPERTIES (
+        "replication_num" = "1"
+    );
+    ```
+* View the data skew of the table
+    ```sql
+    mysql> SHOW DATA SKEW FROM test_show_data_skew2;
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    | PartitionName        | BucketIdx | AvgRowCount | AvgDataSize | Graph     
                | Percent |
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    | test_show_data_skew2 | 0         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>  | 24.73 % |
+    | test_show_data_skew2 | 1         | 4           | 667         | 
>>>>>>>>>>>>>>>>>>>>>>>>> | 25.46 % |
+    | test_show_data_skew2 | 2         | 0           | 0           |           
                | 00.00 % |
+    | test_show_data_skew2 | 3         | 1           | 649         | 
>>>>>>>>>>>>>>>>>>>>>>>>  | 24.77 % |
+    | test_show_data_skew2 | 4         | 2           | 656         | 
>>>>>>>>>>>>>>>>>>>>>>>>> | 25.04 % |
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+
+
+
+    mysql> SHOW DATA SKEW FROM test_show_data_skew2 
PARTITION(test_show_data_skew2);
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    | PartitionName        | BucketIdx | AvgRowCount | AvgDataSize | Graph     
                | Percent |
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    | test_show_data_skew2 | 0         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>  | 24.73 % |
+    | test_show_data_skew2 | 1         | 4           | 667         | 
>>>>>>>>>>>>>>>>>>>>>>>>> | 25.46 % |
+    | test_show_data_skew2 | 2         | 0           | 0           |           
                | 00.00 % |
+    | test_show_data_skew2 | 3         | 1           | 649         | 
>>>>>>>>>>>>>>>>>>>>>>>>  | 24.77 % |
+    | test_show_data_skew2 | 4         | 2           | 656         | 
>>>>>>>>>>>>>>>>>>>>>>>>> | 25.04 % |
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    ```
 
 ### Keywords
 
     SHOW, DATA, SKEW
 
-### Best Practice
+### Best Practice
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-reference/Show-Statements/SHOW-DATA-SKEW.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-reference/Show-Statements/SHOW-DATA-SKEW.md
index fb1de1c6be31..3e42f5e1b576 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-reference/Show-Statements/SHOW-DATA-SKEW.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-reference/Show-Statements/SHOW-DATA-SKEW.md
@@ -36,21 +36,124 @@ SHOW DATA SKEW
 
     语法:
 
-        SHOW DATA SKEW FROM [db_name.]tbl_name PARTITION (partition_name);
+        SHOW DATA SKEW FROM [db_name.]tbl_name [PARTITION (partition_name, 
...)];
 
     说明:
 
-        1. 必须指定且仅指定一个分区。对于非分区表,分区名称同表名。
-        2. 结果将展示指定分区下,各个分桶的数据行数,数据量,以及每个分桶数据量在总数据量中的占比。
+        1. 结果将展示指定分区下,各个分桶的数据行数,数据量,以及每个分桶数据量在总数据量中的占比。
+        2. 对于非分区表,查询结果中分区名称同表名。
 
 ### Example
-
-    1. 查看表的数据倾斜情况
-
-        SHOW DATA SKEW FROM db1.test PARTITION(p1);
+1. 分区表场景
+
+* 建表语句
+    ```sql
+    CREATE TABLE test_show_data_skew
+    (
+      id int, 
+      name string, 
+      pdate date
+    ) 
+    PARTITION BY RANGE(pdate) 
+    (
+      FROM ("2023-04-16") TO ("2023-04-20") INTERVAL 1 DAY
+    ) 
+    DISTRIBUTED BY HASH(id) BUCKETS 5
+    PROPERTIES (
+      "replication_num" = "1"
+    );
+    ```
+* 查询整表的数据倾斜情况
+   ```sql
+    mysql> SHOW DATA SKEW FROM test_show_data_skew;
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    | PartitionName | BucketIdx | AvgRowCount | AvgDataSize | Graph            
                                                                                
    | Percent |
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    | p_20230416    | 0         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                               
                     | 49.77 % |
+    | p_20230416    | 1         | 2           | 654         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                              
                     | 50.23 % |
+    | p_20230416    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230416    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230416    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 0         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 1         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230417    | 4         | 2           | 656         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 | 100.00% |
+    | p_20230418    | 0         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 1         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 | 100.00% |
+    | p_20230418    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230419    | 0         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230419    | 1         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                               
                     | 49.96 % |
+    | p_20230419    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230419    | 3         | 1           | 649         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                              
                     | 50.04 % |
+    | p_20230419    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    ```
+* 查询指定分区的数据倾斜情况
+    ```sql
+    mysql> SHOW DATA SKEW FROM test_show_data_skew PARTITION(p_20230416, 
p_20230418);
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    | PartitionName | BucketIdx | AvgRowCount | AvgDataSize | Graph            
                                                                                
    | Percent |
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    | p_20230416    | 0         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                               
                     | 49.77 % |
+    | p_20230416    | 1         | 2           | 654         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>                              
                     | 50.23 % |
+    | p_20230416    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230416    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230416    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 0         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 1         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 | 100.00% |
+    | p_20230418    | 2         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 3         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    | p_20230418    | 4         | 0           | 0           |                  
                                                                                
    | 00.00 % |
+    
+---------------+-----------+-------------+-------------+------------------------------------------------------------------------------------------------------+---------+
+    ```
+
+2. 非分区表场景
+
+* 建表语句
+    ```sql
+    CREATE TABLE test_show_data_skew2
+    (
+        id int, 
+        name string, 
+        pdate date
+    ) 
+    DISTRIBUTED BY HASH(id) BUCKETS 5
+    PROPERTIES (
+        "replication_num" = "1"
+    );
+    ```
+* 查询整表的数据倾斜情况
+    ```sql
+    mysql> SHOW DATA SKEW FROM test_show_data_skew2;
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    | PartitionName        | BucketIdx | AvgRowCount | AvgDataSize | Graph     
                | Percent |
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    | test_show_data_skew2 | 0         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>  | 24.73 % |
+    | test_show_data_skew2 | 1         | 4           | 667         | 
>>>>>>>>>>>>>>>>>>>>>>>>> | 25.46 % |
+    | test_show_data_skew2 | 2         | 0           | 0           |           
                | 00.00 % |
+    | test_show_data_skew2 | 3         | 1           | 649         | 
>>>>>>>>>>>>>>>>>>>>>>>>  | 24.77 % |
+    | test_show_data_skew2 | 4         | 2           | 656         | 
>>>>>>>>>>>>>>>>>>>>>>>>> | 25.04 % |
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+
+
+
+    mysql> SHOW DATA SKEW FROM test_show_data_skew2 
PARTITION(test_show_data_skew2);
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    | PartitionName        | BucketIdx | AvgRowCount | AvgDataSize | Graph     
                | Percent |
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    | test_show_data_skew2 | 0         | 1           | 648         | 
>>>>>>>>>>>>>>>>>>>>>>>>  | 24.73 % |
+    | test_show_data_skew2 | 1         | 4           | 667         | 
>>>>>>>>>>>>>>>>>>>>>>>>> | 25.46 % |
+    | test_show_data_skew2 | 2         | 0           | 0           |           
                | 00.00 % |
+    | test_show_data_skew2 | 3         | 1           | 649         | 
>>>>>>>>>>>>>>>>>>>>>>>>  | 24.77 % |
+    | test_show_data_skew2 | 4         | 2           | 656         | 
>>>>>>>>>>>>>>>>>>>>>>>>> | 25.04 % |
+    
+----------------------+-----------+-------------+-------------+---------------------------+---------+
+    ```
 
 ### Keywords
 
     SHOW,DATA,SKEW
 
-### Best Practice
+### Best Practice
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to