4 Business scenarios/processes
4.1 Characteristic parameters
To make the TaurusDB field compression feature moreIt is convenient for users to use. Five related parameters have been opened. In "Instance Management", click "Parameter Modification-Parameter" page to adjust the field compression parameters , as shown in Figure 5.
Figure 5 Adjusting field compression parameters
The specific range and meaning of each parameter are shown in Table 1 .
Table 1 Field compression parameter description
4.2 Use
• Explicit compression [ rds_column_compression = 1 ]
For example, explicitly create a compressed field (as shown kenya phone number data in Figure 5, set the default compression algorithm parameter rds_default_column_compression_algorithm = ZLIB), and explicitly mark the compressed attribute compressed for the field to be compressed in the SQL statement. If the compression algorithm is not specified separately, the algorithm specified by the rds_default_column_compression_algorithm parameter is used.
Figure 6 Explicit compression parameter settings
Execute the following SQL statement :
create table t1(c1 varchar(100) compressed, c2 varchar(100) compressed=zlib, c3 varchar(100) compressed=zstd) default charset=latin1;
Explicitly add compression attributes to the three columns in the t1 table, and specify the compression algorithm as ZSTD for the c3 column . View the compression attributes added by explicit compression , as shown in Figure 7 .
Figure 7 View compression properties
• Automatic compression [ rds_column_compression = 2 ]
For example, a compressed field is automatically created (as shown in Figure 8 , setting the field compression threshold parameter rds_column_compression_threshold = 100, and setting the default compression algorithm parameter rds_default_column_compression_algorithm = ZLIB). The SQL statement does not need to be modified, and compression attributes are automatically added to the columns that meet the conditions.