diff --git a/docs/MatrixOne/FAQs/sql-faqs.md b/docs/MatrixOne/FAQs/sql-faqs.md index 7e9b45f74..9eb597f9d 100644 --- a/docs/MatrixOne/FAQs/sql-faqs.md +++ b/docs/MatrixOne/FAQs/sql-faqs.md @@ -128,8 +128,26 @@ Currently it can be viewed through the "show create table temporary table name" **How do I view my Query execution plan?** - To see how MatrixOne executes on a given query, you can use the [`EXPLAIN`](../Reference/SQL-Reference/Other/Explain/explain.md) statement, which prints out the query plan. +To see how MatrixOne executes on a given query, you can use the [`EXPLAIN`](../Reference/SQL-Reference/Other/Explain/explain.md) statement, which prints out the query plan. - ``` - EXPLAIN SELECT col1 FROM tbl1; - ``` +```sql +EXPLAIN SELECT col1 FROM tbl1; +``` + +**How to check the table compression ratio?** + +To check the table compression ratio in MatrixOne, you can use the following SQL query: + +```sql +mysql> select ( sum(compress_size) + 1) / ( sum(origin_size) +1 ) from metadata_scan('db1.students', '*') m; ++---------------------------------------------------+ +| (sum(compress_size) + 1) / (sum(origin_size) + 1) | ++---------------------------------------------------+ +| 0.44582681643679795 | ++---------------------------------------------------+ +1 row in set (0.01 sec) +``` + +The compression ratio of the `students` table is approximately: 1 - 44.96% = 55.04%. + +**NOTE:** During the data compression process, if the data has not yet been written from memory to disk, the compression ratio obtained from the query may not be accurate. Typically, data will be written to disk within 5 minutes, so it is recommended to wait until the data is flushed to disk before performing the query. \ No newline at end of file diff --git a/docs/MatrixOne/Test/performance-testing/TPCC-test-with-matrixone.md b/docs/MatrixOne/Test/performance-testing/TPCC-test-with-matrixone.md index add4cf059..c90893f57 100644 --- a/docs/MatrixOne/Test/performance-testing/TPCC-test-with-matrixone.md +++ b/docs/MatrixOne/Test/performance-testing/TPCC-test-with-matrixone.md @@ -30,7 +30,7 @@ Now you can execute commands step by step as the following descriptions. ### 1. Configure the *props.mo* file -After the mo-tpch repository is cloned, open the *mo-tpcc* directory, and modify the configuration items of the *props.mo* file. The number of warehouses +After the mo-tpcc repository is cloned, open the *mo-tpcc* directory, and modify the configuration items of the *props.mo* file. The number of warehouses can be configurable by the `warehouse=XX` row in this file. ``` @@ -68,7 +68,7 @@ cd mo-tpcc __Npte__: If you get an error like `java:command not found` while running `./runSQL.sh props.mo tableCreates`, install or reinstall Java and the JDK on your computer. -The above code means to enter the *mo-tpch* directory and create the TPCC database and table. +The above code means to enter the *mo-tpcc* directory and create the TPCC database and table. The following is an example of the command output: