For practical examples, getting started guidance, and compression best practices, see the Table and Column Compression overview.
General-purpose codecs
LZ4
Syntax:lz4
or lz4()
Description: Fast lossless compression algorithm optimized for speed over compression ratio. Default compression codec in Firebolt.
Parameters: None
Performance characteristics:
- Compression speed: Very fast
- Decompression speed: Very fast
- Typical compression ratio: Good
- CPU usage: Very low
- High-throughput data ingestion
- Frequently accessed data requiring fast queries
- Real-time analytics workloads
- When CPU resources are limited
LZ4HC (LZ4 High Compression)
Syntax:lz4hc(level)
where level is 1-12
Description: High-compression variant of LZ4 that trades slower compression for better compression ratios while maintaining fast decompression.
Parameters:
level
: Compression level (1-12, default: 9)- Levels 1-6: Faster compression, lower ratio
- Levels 7-9: Balanced performance (recommended)
- Levels 10-12: Maximum compression, slower writes
- Compression speed: Moderate
- Decompression speed: Very fast
- Typical compression ratio: Better than LZ4
- CPU usage: Low to moderate
- Write-heavy workloads where read performance is critical
- Balanced storage and performance requirements
- Data with moderate access patterns
ZSTD (Zstandard)
Syntax:zstd(level)
where level is 1-22
Description: Modern compression algorithm providing excellent balance between compression ratio and speed with highly configurable compression levels.
Parameters:
level
: Compression level (1-22, default: 1)- Levels 1-5: Fast compression, good for online workloads
- Levels 6-10: Balanced performance
- Levels 11-15: High compression for archival data
- Levels 16-22: Maximum compression, very slow
Level | Compression Speed | Compression Ratio | Use Case |
---|---|---|---|
1 | Fast | Good | Real-time data |
3 | Fast | Better | General workloads |
7 | Moderate | Better | Balanced storage/speed |
15 | Slow | Excellent | Archival data |
22 | Very slow | Excellent | Maximum compression |
- General analytics workloads (levels 1-5)
- Archival data storage (levels 10+)
- Data with good compressibility (JSON, text, logs)
NONE
Syntax:none
Description: Disables compression entirely. Data is stored uncompressed.
Parameters: None
Performance characteristics:
- Compression speed: N/A (no compression)
- Decompression speed: N/A (no decompression)
- Compression ratio: None (no compression)
- CPU usage: None
- Already compressed data (images, videos, compressed files)
- Data that compresses poorly
- Debugging compression issues
- Maximum query performance at cost of storage
DEFAULT
Syntax:default
Description: Uses system default compression, which is equivalent to lz4
.
Parameters: None
Best for:
- Inheriting table-level compression settings
- Removing column-specific compression overrides
Specialized (preprocessing) codecs
Delta
Syntax:delta
Description: Stores differences between consecutive values instead of absolute values. Highly effective for sequential or slowly-changing numeric data.
Parameters: None
Performance characteristics:
- Compression speed: Fast
- Decompression speed: Fast
- Compression ratio: Highly variable, excellent for sequential data
- CPU usage: Very low
NOT NULL
only)
Best for:
- Sequential IDs (user_id, order_id, event_id)
- Monotonic counters
- Timestamps in time-series data
- Any slowly changing numeric values
DoubleDelta
Syntax:doubledelta
Description: Stores differences of differences, optimized for monotonic sequences with relatively constant intervals (like regular time series).
Parameters: None
Performance characteristics:
- Compression speed: Fast
- Decompression speed: Fast
- Compression ratio: Excellent for regular time series
- CPU usage: Low
- Regular time-series timestamps (every minute, hour, day)
- Monotonic sequences with consistent intervals
- Event timestamps in ordered data
Gorilla
Syntax:gorilla
Description: Optimized for floating-point values that change slowly over time. Uses XOR-based encoding to efficiently store small changes between consecutive values.
Parameters: None
Performance characteristics:
- Compression speed: Moderate
- Decompression speed: Fast
- Compression ratio: Excellent for time-series floats
- CPU usage: Low to moderate
- Sensor readings that change gradually
- Financial time series (prices, rates)
- IoT device metrics
- Any slowly-changing floating-point data
Chaining strategies
Two-stage chains (Recommended)
Most effective combinations for common use cases:Three-stage chains (Advanced)
For maximum compression on specific data patterns:Backward compatibility
Legacy syntax support
For backward compatibility, the older compression syntax remains supported forlz4
and zstd
codecs only:
- Only
lz4
andzstd
codecs supported - No specialized codecs (
delta
,gorilla
,doubledelta
) - No compression chaining capabilities
- No access to advanced parameters
- Support for all compression codecs
- Compression chaining capabilities
- Access to specialized codecs
- Consistent parameter syntax
- Future feature compatibility
See also
- Table and Column Compression - Practical guide with examples, best practices, and getting started information