Updated on 2022-08-16 GMT+08:00

MySQL SQL Configuration

MySQL parameters are used to customize rules for MySQL script migration.

Open the features-mysql.properties file in the config folder and configure parameters in the features-mysql.properties file as required.

Table 1 Parameters in the features-mysql.properties file

Parameter

Description

Value Range

Default Value

Example

  • table.databaseAsSchema
  • table.defaultSchema

Whether to use a database name as the schema name. If a database name does not exist, the user-defined schema specified by table.schema will be used. If table.schema is not specified, the default schema will be used.

  • true
  • false
  • public
  • true
  • public
  • table.databaseAsSchema=true
  • table.defaultSchema=public
  • table.schema

Name of the user-defined schema. If this parameter is specified, it will be directly used. In this case, even if useDatabaseAsSchema is set to true, the name of the current schema will be used.

  • schemaName
  • null
  • table.schema=
  • table.orientation

Default data storage mode. Value ROW means row storage, and value COLUMN means column storage.

  • ROW
  • COLUMN
  • ROW
  • table.orientation=ROW
  • table.type

Default table type, which can be partitioned table (HASH) or replication table (REPLICATION)

  • HASH
  • REPLICATION
  • HASH
  • table.type=HASH
  • table.tablespace

Tablespace options

  • COMMENT
  • RESERVE
  • RESERVE
  • table.tablespace=RESERVE
  • table.partition-key.choose.strategy

Policy for selecting the partition key

  • com.huawei.hwclouds.scs.dws.DWSPartitionKeyChooserStrategy
  • com.huawei.hwclouds.scs.dws.DWSPartitionKeyChooserStrategy
  • table.partition-key.choose.strategy=com.huawei.hwclouds.scs.dws.DWSPartitionKeyChooserStrategy
  • table.partition-key.name

Partition key. If this parameter is not specified, the default selection policy will be used. If there are multiple columns, separate them with commas (,). The column names are case insensitive.

  • Reserved parameter
  • null
  • table.partition-key.name=
  • table.compress.mode

Compression mode. If keyword COMPRESS is specified in CREATE TABLE, the compression feature will be triggered in the case of bulk INSERT operations. If this feature is enabled, a scan will be performed on all tuple data within the page to generate a dictionary and then the tuple data will be compressed and stored. If NOCOMPRESS is used, tables will not be compressed.

  • COMPRESS
  • NOCOMPRESS
  • NOCOMPRESS
  • table.compress.mode=NOCOMPRESS
  • table.compress.row

  • table.compress.column

Compression level of table data. It determines the compression ratio and duration. Generally, the higher the level of compression, the higher the ratio, the longer the duration, vice versa. The actual compression ratio depends on the distribution mode of table data loaded. Valid values for row-store tables are YES and NO, and the default is NO. Valid values for column-store tables are YES, NO, LOW, MIDDLE, and HIGH, and the default is LOW.

  • YES
  • NO

  • YES
  • NO
  • LOW
  • MIDDLE
  • HIGH
  • NO

  • LOW
  • table.compress.row=NO

  • table.compress.column=LOW
  • table.compress.level

Table data compression ratio and duration at the same compression level. This divides a compression level into sublevels, providing more choices for the compression ratio and duration. As the value becomes larger, the compression ratio becomes higher and duration longer at the same compression level.

  • 0
  • 1
  • 2
  • 3
  • 0
  • table.compress.level=0
  • table.database.template

Database template

  • Reserved parameter
  • template0

table.database.template=template0