HomeMogDBMogDB StackUqbar
v3.1

Documentation:v3.1

Supported Versions:

Other Versions:

Enhancement of Astore Row-Level Compression

Availability

This feature is available since MogDB 3.1.0.

Introduction

MogDB 3.1.0 completely inherits compression-related SQL syntaxes from MogDB 3.0.0, including create table, alter table, vacuum, copy, and primary/standby replication. The compression feature is greatly improved and optimized in implementation of kernel. Compared with MogDB 3.0.0, high compression ratio can be realized under the same performance.

Benefits

Purpose Result
Create a compression table Storage cost is saved and the performance is improved.
Modify the table compression attribute The table compression can be flexibly configured to adapt to different scenarios
Perform write/read operations on a compression table (compression and decompression are automatically finished during the write/read.) The compression/decompression operation is transparent during write/read.
Perform primary/standby synchronization of the compression table The performance of the primary and standby compression table is the same.
Perform the vacuum full operation on the compression table After the vacuum full operation, the compression table can keep the normal compression status.
After data is copied to a compression table, data is automatically compressed. The copy operation is performed on the foreground. Once data is imported, compression is finished.
Show the system compression status The GS_COMPRESSION view can be used for querying the compression status of each table.

Description

1. Creation of Compression Tables

With the newly added row-level compression-related parameters of CREATE TABLE, compression tables can be created, including ordinary tables, partition tables (first-level and secondary-level partition table), temporary tables, unlogged tables, and materialized views. After compression tables are created, write data into tables. The database system will automatically compress the tables. The compression process is transparent to users, and users can judge whether a table is a compression table through the table-related attributes.

Feature Constraints

  • This feature is effective to only the Astore row-store tables. It cannot be used for Ustore row-store tables, column-store tables, and MOT tables.
  • After compression tables are created, DDL and DML-related operations on the compression tables are transparent to users.
  • Non-compression tables are created by default.
  • The system tables cannot be specified with the compression attribute.
  • The foreign tables cannot be specified with the compression attribute.
  • The tablespace compression attribute is not supported.

2. Modification of Compression Tables

Non-compressed tables can be modified as compression tables by using ALTER TABLE or vice versa.

Feature Constraints

  • With the increased compression feature of ALTER TABLE, new data will be compressed. However, the inventory data is not compressed immediately but asynchronously compressed by the background tasks.
  • When the compression feature is disabled, new data is not compressed, and the inventory data is kept in the compression status.
  • The compression attribute of the table and index are independent of each other. Their compression features are set through related syntaxes, respectively.

3. Compression Table Write/Read

During write/read of a compression table, the system automatically finishes compression and decompression, which is transparent to users.

4. Synchronization of Compression Tables

Primary/standby synchronization of compression tables is supported to keep data consistency.

5. Vacuum/Vacuum Full

The compression table of the old versions can be reclaimed. Expired data can be cleared.

6. Data Import

You can import data to a compression table by using the copy from command, including parallel import meanwhile data compression is finished synchronously. In typical scenarios, the compression ratio can be increased by two to four times, and the copy performance loss is low by lower than 20%.

7. Compression Table View

GS_COMPRESSION is increased to observe the compression status of all compression tables in the system.

CREATE TABLE, ALTER TABLE, VACUUM, COPY, GS_COMPRESSION

Copyright © 2011-2024 www.enmotech.com All rights reserved.