Squish: Near-Optimal Compression for Archival of Relational Datasets

Yihan Gao, Aditya G. Parameswaran · DOI

Abstract

SQUISH is a specialized compression system for relational databases that achieves near-entropy compression rates by combining Bayesian Networks with Arithmetic Coding. By learning the statistical dependencies between table columns, it can reduce storage requirements by over 50% compared to state-of-the-art semantic compressors and standard tools like gzip.

Introduction

We are drowning in relational data—from IoT sensor logs to massive genomic databases. While storage costs are falling, the sheer volume of data makes archival (long-term storage for legal, historical, or ML purposes) a significant expense.

Standard compression tools like gzip (based on Lempel-Ziv) are "syntactic": they look for repeating patterns of bytes. However, relational data has "semantic" structure. For example, if a column for "City" says "San Francisco," the "Zip Code" column becomes highly predictable. Standard tools ignore these correlations. Previous "semantic" compressors existed, but they often struggled with numerical data, lacked support for user-defined types, or used suboptimal encoding schemes that didn't reach the theoretical limits of compression.

Comparison of SQUISH with other compression systems across key features.

The SQUISH Pipeline

SQUISH introduces a pipeline that treats compression as a machine learning problem. The process involves three main stages:

  1. Bayesian Network (BN) Learning: The system analyzes the dataset to find dependencies between attributes. It uses a greedy structure-learning algorithm with a custom objective function designed specifically to minimize the final compressed size, balancing model complexity against data reduction.
  2. Arithmetic Coding (AC): Once the BN defines the probability of an attribute given its "parents" in the network, SQUISH uses Arithmetic Coding to turn those probabilities into bits. AC is mathematically near-optimal, mapping high-probability sequences to very short bitstrings.
  3. The SQUID Interface: To handle data that isn't just simple categories (like floating-point numbers or long strings), the authors created SQUID (SQUISH Interface for Data types). It treats every attribute as a path down a (potentially infinite) decision tree, allowing Arithmetic Coding to work on continuous or complex data.
The SQUISH compression pipeline, from dataset to compressed database.

Key Insights

  • Compression as Probability Estimation: If you can perfectly predict the next value in a table, it takes zero bits to store. SQUISH uses Bayesian Networks because they are excellent at capturing the "conditional entropy" of a table.
  • Unified Handling of Lossy and Lossless: By adjusting the "leaf nodes" in the SQUID decision trees, SQUISH can seamlessly switch between lossless compression and lossy compression (where the user defines a maximum tolerable error).
  • Random Access: Unlike gzip, which requires decompressing large blocks to see a single row, SQUISH’s model-based approach allows for faster random access to individual tuples.

Evaluation and Results

The authors evaluated SQUISH on four diverse datasets: Corel (numerical), Forest-Cover (mixed), Census (categorical), and Genomes (large-scale).

  • Superior Compression: SQUISH achieved a 50% reduction in storage size on the Forest-Cover dataset and a 75% reduction on the Corel dataset compared to the nearest competitor, ItCompress.
  • Outperforming Gzip: On the Census and Genomes datasets, SQUISH reduced the file size by 48% and 56% respectively compared to gzip.
  • Scalability: SQUISH successfully handled the 18.2GB Genomes dataset, a scale that crashed or timed out previous semantic compression systems.

Conclusion

SQUISH is optimized for "write-once, read-rarely" archival. While the structure learning complexity ($O(m^4n)$) can be a bottleneck for tables with thousands of columns, its near-optimal compression rates and support for user-defined types make it a powerful tool for long-term data storage.

Summary updated

BibTeX
@inproceedings{gao2016squish,
  author = {Yihan Gao and Aditya G. Parameswaran},
  title = {{Squish: Near-Optimal Compression for Archival of Relational Datasets}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2016},
  doi = {10.1145/2939672.2939867},
}
Figure