This guide provides detailed information about each compression codec in HeliosDB-Lite, including optimal use cases, data characteristics, and estimated compression ratios for 10GB data scenarios.
HeliosDB-Lite includes five specialized compression codecs, each optimized for different data patterns:
Codec
Target Data
Typical Ratio
Speed
ALP
Floating-point numbers
2-4x
Very Fast
FSST
Strings with patterns
2-3x
Fast
Dictionary
Low-cardinality columns
5-20x
Very Fast
RLE
Repetitive/sorted data
10-100x
Fastest
Delta
Sequential numbers
2-10x
Very Fast
ALP - Adaptive Lossless floating-Point
Description
ALP (Adaptive Lossless floating-Point) is a lossless compression algorithm for IEEE 754 floating-point data. Based on ACM SIGMOD 2024 research, it automatically adapts between two strategies:
ALP Classic: For decimal-origin data (financial, percentages, measurements)
ALP-RD: For high-precision floats (scientific, ML weights)
Technical Characteristics
Encoding Speed: ~0.5 doubles per CPU cycle
Decoding Speed: ~2.6 doubles per CPU cycle
Compression: 100% lossless (zero precision loss)
Block Size: 1024 values (optimized for CPU cache)
Good Use Cases
Use Case
Description
Expected Ratio
10GB Scenario
Financial Data
Prices: $10.12, $99.95, $1234.56
3-4x
10GB → 2.5-3.3GB
Sensor Readings
Temperature: 23.5°C, 24.1°C, 23.8°C
3-4x
10GB → 2.5-3.3GB
Percentages
Values: 0.25, 0.50, 0.75, 0.33
4x
10GB → 2.5GB
Coordinates
GPS: -122.4194, 37.7749
2.5-3x
10GB → 3.3-4GB
Measurements
Scientific: 9.81, 3.14159, 2.718
2-3x
10GB → 3.3-5GB
Example - Price Data (10GB):
CREATETABLEorders (
id INTPRIMARY KEY,
price FLOAT8, -- ALP: 10GB → ~2.5GB
quantity INT
) WITH (compression='alp');
Bad Use Cases
Use Case
Why It’s Bad
Expected Ratio
Recommendation
Random doubles
No patterns to exploit
1.0-1.2x
Don’t compress
ML weights
Full precision, random distribution
1.2-1.5x
Consider storing as binary
Encrypted data
Appears random
~1.0x
Don’t compress
Already compressed
No further reduction
~1.0x
Store raw
Example - Poor Compression:
Input: Random f64 values from rand::random()
Original: 10GB
Compressed: ~9GB (only 10% savings)
Overhead may not be worth it
10GB Data Estimates
Data Pattern
Compression Ratio
Compressed Size
Space Saved
Financial prices (2 decimals)
4.0x
2.5 GB
7.5 GB (75%)
Scientific measurements
3.0x
3.3 GB
6.7 GB (67%)
GPS coordinates
2.5x
4.0 GB
6.0 GB (60%)
Time-series sensor data
3.5x
2.9 GB
7.1 GB (71%)
Random doubles
1.2x
8.3 GB
1.7 GB (17%)
Ratios by Value Pattern
Figures from internal tests (HeliosDB Lite ALP codec, representative fixtures); reproduce on your own hardware and data.
FSST (Fast Static Symbol Table) is a lightweight string compression algorithm that encodes common substrings (1-8 bytes) using a symbol table trained on sample data. It provides random access to individual strings.
Technical Characteristics
Compression Speed: 1-3 GB/sec
Decompression Speed: 1-3 GB/sec
Symbol Table Size: ~2-3 KB per column
Random Access: Yes (individual strings decompressible)
Input: 10GB of UUIDs (550a8400-e29b-41d4-a716-446655440000)
Compressed: ~8.5GB (only 15% savings)
Symbol table overhead may exceed savings
10GB Data Estimates
Data Pattern
Compression Ratio
Compressed Size
Space Saved
Email addresses (common domains)
3.0x
3.3 GB
6.7 GB (67%)
URLs (same site)
2.5x
4.0 GB
6.0 GB (60%)
Server logs (structured)
3.0x
3.3 GB
6.7 GB (67%)
JSON records
2.0x
5.0 GB
5.0 GB (50%)
UUIDs
1.2x
8.3 GB
1.7 GB (17%)
Random text
1.1x
9.1 GB
0.9 GB (9%)
Ratios by String Type
Figures from internal tests (HeliosDB Lite FSST codec, representative fixtures); reproduce on your own data.
Data Type
Compression Ratio
Email addresses
2-3x
URLs
3-4x
JSON logs
4-5x
UUIDs
2-3x
Repeated text
3-5x
Random strings
1.0-1.5x
Dictionary Encoding
Description
Dictionary encoding replaces repeated values with compact integer indices into a dictionary of unique values. Ideal for columns with few unique values (low cardinality).
) WITH (compression_columns ='status:dictionary');
Bad Use Cases
Use Case
Why It’s Bad
Expected Ratio
Recommendation
High cardinality
>50% unique values
0.8-1.5x
Use FSST
User IDs
Mostly unique values
~1.0x
Don’t compress
Timestamps
All different
~1.0x
Use Delta
Free-text fields
High uniqueness
~1.0x
Use FSST
>65,536 unique
Exceeds dictionary limit
Fails
Use FSST
Example - Poor Compression:
Input: 10GB of unique user IDs (user_12345, user_12346, ...)
Dictionary Size: Would exceed 65,536 limit or be nearly 1:1
Recommendation: Use FSST or store uncompressed
10GB Data Estimates
Data Pattern
Unique Values
Compression Ratio
Compressed Size
Space Saved
State (3 values)
3
50x
200 MB
9.8 GB (98%)
Country codes
200
8x
1.25 GB
8.75 GB (87.5%)
Product categories
500
6x
1.67 GB
8.33 GB (83.3%)
User types
10
20x
500 MB
9.5 GB (95%)
City names
10,000
4x
2.5 GB
7.5 GB (75%)
Unique emails
1,000,000+
~1.0x
~10 GB
~0 GB (0%)
RLE - Run-Length Encoding
Description
Run-Length Encoding compresses sequences of repeated values into (value, count) pairs. Extremely effective for sorted columns or data with long runs of identical values.
Technical Characteristics
Minimum Run Length: 3 (shorter runs stored verbatim)
Maximum Run Length: 4.2 billion per entry
Encoding Speed: Fastest (simple counting)
Decoding Speed: Fastest (simple expansion)
Good Use Cases
Use Case
Description
Expected Ratio
10GB Scenario
Sorted partition keys
Same value for millions of rows
100-10,000x
10GB → 1-100MB
Time-bucketed data
Same hour/day for many rows
50-500x
10GB → 20-200MB
Flag columns (sorted)
0,0,0,…,1,1,1
100-1000x
10GB → 10-100MB
Sparse data
Mostly NULLs or zeros
50-200x
10GB → 50-200MB
Clustered keys
Same foreign key in batches
20-100x
10GB → 100-500MB
Example - Sorted Partition (10GB):
-- Data sorted by region (4 regions, 2.5GB each)
CREATETABLEevents (
region TEXT, -- RLE: 10GB → ~1MB (only 4 runs!)
event_time TIMESTAMP,
dataTEXT
) WITH (compression_columns ='region:rle');
Extreme Example:
Input: 10GB of "active" status (all same value)
Runs: 1
Compressed: ~20 bytes (value + count)
Ratio: ~500,000,000x
Bad Use Cases
Use Case
Why It’s Bad
Expected Ratio
Recommendation
Random/unsorted
No consecutive duplicates
0.5-1.0x
Use Dictionary
High cardinality unsorted
Every value different
~0.5x (worse)
Don’t use RLE
Alternating values
A,B,A,B,A,B…
~0.3x (worse)
Use Dictionary
UUIDs
All unique
~0.5x (worse)
Don’t compress
Example - Poor Compression:
Input: 10GB of alternating true/false values
Runs: 5 billion (one per value)
Compressed: ~40GB (4x LARGER due to overhead!)
CRITICAL: RLE makes this data WORSE
10GB Data Estimates
Data Pattern
Run Count
Compression Ratio
Compressed Size
Space Saved
Sorted partition (4 values)
4
10,000x+
~1 MB
9.999 GB (99.99%)
Hourly buckets (8760/year)
8,760
1,000x
10 MB
9.99 GB (99.9%)
Daily flags (sorted)
365
5,000x
2 MB
9.998 GB (99.98%)
Clustered FK (1000 groups)
1,000
500x
20 MB
9.98 GB (99.8%)
Unsorted random
5 billion
0.5x
20 GB
-10 GB (WORSE)
Delta Encoding
Description
Delta encoding stores differences between consecutive values instead of absolute values. Uses zigzag + variable-length encoding for compact storage of small deltas.
Technical Characteristics
Supported Types: INT4, INT8 (32/64-bit integers)
Encoding: Zigzag encoding for signed deltas
Storage: Variable-length integers (1-10 bytes per delta)
Decoding: Sequential (requires reading from start)