GBase 8s Data Compression Strategy (Part 1)
This article (Chapter 1 of 2) provides a detailed introduction to the data compression features of GBase 8s, including the purpose, methods, commands, and limitations of compression. GBase 8s data compression is used when storage space is limited, to reduce data footprint and improve data processing efficiency. It is also recommended to compress infrequently updated tables and fragments. It delivers an effective solution for saving storage space and improving I/O efficiency.
01 Purpose of Data Compression
1. Save storage space and associated costs
2. Improve I/O efficiency
1) The database reads compressed data
2) Time saved from reduced I/O exceeds the time required to decompress data in memory
3. Improve read performance
4. Write performance may slightly degrade
02 Compression Methods
1. Automatic Compression for New Tables
1) Automatic compression:
CREATE TABLE cust5 ( ...) COMPRESSED
a. Automatically generate data dictionary
b. Automatically compress data
Light Append Method
The light append method bypasses the buffer pool for faster data loading.
It is automatically enabled when both of the following conditions are met:
1. Row table
2. No index
2. Disable Automatic Compression:
task/admin(table uncompress)
3. Recompress:
tash/admin(table compress)
4. Control Fragment Decompression:
task/admin(fragment compress/uncompress)
03 Compressing Existing Tables
1. Enable Data Compression
EXECUTE FUNCTION TASK('enable compression');
2. Create Compression Dictionary
execute function task('table create_dctionary', 'stdtab', 'test',‘gbasedbt');
3. Consolidate data space by moving unused space to the end of the table or fragment;
execute function task('table compress repack', 'stdtab', 'test',‘gbasedbt');
4. Return the unused space from the table or fragment to the database space;
execute function task('table shrink', 'stdtab', 'test',‘gbasedbt');execute function task('fragment shrink', ‘partn');