Comparing Incomplete Database Instances

Boris Glavic, Giansalvatore Mecca, Renée J. Miller, Paolo Papotti, Donatello Santoro, Enzo VeltriSEBD 2024

Introduction

In modern data management environments, such as data lakes and automated cleaning pipelines, datasets are rarely pristine. They frequently contain "incomplete" information—records riddled with missing values (nulls) and lacking consistent primary keys. This lack of metadata makes comparing different versions of a dataset a significant challenge. Standard database comparison tools, which rely on joining tables via unique identifiers, fail in these scenarios.

Examples of incomplete database instances with missing values and varying records.

Determining the similarity between two incomplete instances is a computationally intensive task. Formally, it is an NP-hard problem because it requires finding the optimal mapping between every tuple in one set and every tuple in the other, all while accounting for the ambiguity of null values. This paper introduces a framework and a high-performance algorithm to solve this problem efficiently.

The Mapping Framework

The authors propose a formal scoring framework based on "Instance Matches." This approach defines similarity through mappings between both tuples and the specific values within them.

Illustration of tuple and value mapping between two incomplete database instances.

A key feature of this framework is how it handles uncertainty. It treats labeled nulls as variables rather than empty space; if two rows share the same labeled null, the system recognizes a relationship between them. Furthermore, the scoring function penalizes "non-injectivity." For instance, if a mapping collapses multiple distinct null values into a single constant, the similarity score is reduced to reflect the loss of certainty and distinctness in the data.

Algorithmic Solutions

To address the computational complexity, the paper evaluates three algorithmic approaches:

  1. The Exact Algorithm: This exhaustive method explores all possible compatible tuple pairs to find the absolute best mapping. While it provides a perfect baseline, it is too slow for practical use on large datasets.
  2. The Signature Algorithm: This is the paper's primary innovation. It utilizes a "Signature"—a positional encoding of the constants present within a tuple. By greedily matching tuples that share the most constants first, the algorithm collapses the search space. Once these "easy" matches are established, it performs a targeted search for the remaining ambiguous tuples.

Experimental Evaluation

The researchers tested their algorithms on three datasets: Doctors (synthetic data for cleaning), Bikeshare (real-world trip data), and GitHub (a wide dataset with 19 attributes).

The results demonstrated that the Signature Algorithm is both highly accurate and remarkably fast. It achieved an error rate of less than 1% compared to the Exact Algorithm, often as low as 0.005%. More importantly, it delivered a speedup of up to three orders of magnitude (1,000x). While the Exact Algorithm timed out after 8 hours on larger datasets, the Signature Algorithm processed them in mere seconds or minutes.

Conclusion and Future Work

By leveraging the constants within incomplete records as anchors, the Signature Algorithm transforms an exponential matching problem into a manageable polynomial-time task. This framework not only provides a similarity score but also generates an explicit mapping that serves as an "explanation" for the results. Future work will focus on further optimizing the algorithm for extremely wide tables, as performance was shown to be sensitive to the number of attributes in the dataset.

Summary updated

BibTeX
@inproceedings{glavic2024comparing,
  author = {Boris Glavic and Giansalvatore Mecca and Renée J. Miller and Paolo Papotti and Donatello Santoro and Enzo Veltri},
  title = {{Comparing Incomplete Database Instances}},
  booktitle = {SEBD},
  year = {2024},
}
Figure