Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #597

Merged
merged 2 commits into from
Oct 12, 2024
Merged

fix #597

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading