mo_ssb_open Tool Guide
mo_ssb_open
is a tool that implements SSB testing for MatrixOne.
Note
The mo_ssb_open
tool is currently only supported for deployment on Linux system x86 architectures.
Pre-dependency
- Finished installing and starting MatrixOne
- Environment encoding set to UTF-8
- Installed wget
- The bc command is installed
Install mo_ssb_open
wget https://github.com/matrixorigin/mo_ssb_open/archive/refs/tags/v1.0.1.zip unzip v1.0.1.zip
Generate Data Set
cd mo_ssb_open-1.0.1 ./bin/gen-ssb-data.sh -s 1 -c 5
-s: means generating a dataset of about 1GB, no parameters specified, 100G data generated by default,
-c: Indicates the number of threads generating lineorder table data. Default is 10 threads.
Generating a complete data set may take some time. When you are done, you can see the result file in the mo_ssb_open-1.0.1/bin/ssb-data/ directory.
root@host-10-222-4-8:~/soft/ssb/mo_ssb_open-1.0.1/bin/ssb-data# ls -l
total 604976
-rwS--S--T 1 root root 2837046 Jun 7 03:31 customer.tbl
-rw-r--r-- 1 root root 229965 Jun 7 03:31 date.tbl
-rw-r--r-- 1 root root 118904702 Jun 7 03:31 lineorder.tbl.1
-rw-r--r-- 1 root root 119996341 Jun 7 03:31 lineorder.tbl.2
-rw-r--r-- 1 root root 120146777 Jun 7 03:31 lineorder.tbl.3
-rw-r--r-- 1 root root 120000311 Jun 7 03:31 lineorder.tbl.4
-rw-r--r-- 1 root root 120057972 Jun 7 03:31 lineorder.tbl.5
-rw-r--r-- 1 root root 17139259 Jun 7 03:31 part.tbl
-rw-r--r-- 1 root root 166676 Jun 7 03:31 supplier.tbl
Building tables in MatrixOne
Modify the configuration file conf/matrxione.conf to specify the address, username, password for MatrixOne. An example configuration file is shown below
# MatrixOne host
export HOST='127.0.0.1'
# MatrixOne port
export PORT=6001
# MatrixOne username
export USER='root'
# MatrixOne password
export PASSWORD='111'
# The database where SSB tables located
export DB='ssb'
Then execute the following script to build the table.
./bin/create-ssb-tables.sh
Connect to MatrixOne to view and build table successfully.
mysql> show tables;
+----------------+
| Tables_in_ssb |
+----------------+
| customer |
| dates |
| lineorder |
| lineorder_flat |
| part |
| supplier |
+----------------+
6 rows in set (0.01 sec)
Import Data
Execute the following script to import the data required for the ssb test:
./bin/load-ssb-data.sh -c 10
Parameter interpretation
-c: You can specify the number of threads to perform the import, which defaults to 5.
Once loaded, you can query the data in MatrixOne using the created table.
Run the query command
query result first column is query coding,
- Multiple table queries
root@host-10-222-4-8:~/soft/ssb/mo_ssb_open-1.0.1# ./bin/run-ssb-queries.sh
mysqlslap Ver 8.0.37 for Linux on x86_64 (MySQL Community Server - GPL)
mysql Ver 8.0.37 for Linux on x86_64 (MySQL Community Server - GPL)
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
HOST: 127.0.0.1
PORT: 6001
USER: root
DB: ssb
q1.1: 0.22 0.16 0.13 fast:0.13
q1.2: 0.17 0.17 0.17 fast:0.17
q1.3: 0.15 0.19 0.18 fast:0.15
q2.1: 0.22 0.21 0.23 fast:0.21
q2.2: 0.18 0.17 0.16 fast:0.16
q2.3: 0.15 0.16 0.17 fast:0.15
q3.1: 0.24 0.23 0.23 fast:0.23
q3.2: 0.16 0.16 0.20 fast:0.16
q3.3: 0.16 0.14 0.13 fast:0.13
q3.4: 0.12 0.11 0.11 fast:0.11
q4.1: 0.24 0.22 0.30 fast:0.22
q4.2: 0.22 0.21 0.22 fast:0.21
q4.3: 0.20 0.21 0.20 fast:0.20
total time: 2.23 seconds
Finish ssb queries.
- Single table query
root@host-10-222-4-8:~/soft/ssb/mo_ssb_open-1.0.1# ./bin/run-ssb-flat-queries.sh
mysqlslap Ver 8.0.37 for Linux on x86_64 (MySQL Community Server - GPL)
mysql Ver 8.0.37 for Linux on x86_64 (MySQL Community Server - GPL)
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
HOST: 127.0.0.1
PORT: 6001
USER: root
DB: ssb
q1.1: 0.21 0.13 0.14 fast:0.13
q1.2: 0.15 0.13 0.15 fast:0.13
q1.3: 0.16 0.21 0.22 fast:0.16
q2.1: 0.36 0.34 0.38 fast:0.34
q2.2: 0.36 0.34 0.32 fast:0.32
q2.3: 0.25 0.26 0.22 fast:0.22
q3.1: 0.39 0.39 0.30 fast:0.30
q3.2: 0.32 0.33 0.29 fast:0.29
q3.3: 0.22 0.23 0.29 fast:0.22
q3.4: 0.32 0.28 0.31 fast:0.28
q4.1: 0.42 0.38 0.38 fast:0.38
q4.2: 0.42 0.48 0.45 fast:0.42
q4.3: 0.35 0.34 0.29 fast:0.29
total time: 3.48 seconds
Finish ssb-flat queries.
The query results correspond to: query statement, first query result, second query result, third query result, and fastest result in s.
Note
You can view specific query statements in the mo_ssb_open-1.0.1/ssb-queries directory.