Skip to content

Commit

Permalink
Merge pull request #597 from yangj1211/fix
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
yangj1211 authored Oct 12, 2024
2 parents 9ebc746 + d0050b8 commit be2744f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
26 changes: 22 additions & 4 deletions docs/MatrixOne/FAQs/sql-faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

```
Expand Down Expand Up @@ -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:

Expand Down

0 comments on commit be2744f

Please sign in to comment.