Abstract
Metaquerying is a powerful second-order logic framework for discovering patterns across relational database tables. Despite its potential, metaquerying faces significant hurdles: it is NP-Hard, relies on unstable support metrics, and suffers from high computational costs due to massive table joins. This paper addresses these issues by redefining "support" to be more intuitive for relational data and introducing a histogram-based filtration algorithm. By calculating upper bounds on support to prune the search space, the proposed method reduces execution time by over 50%.
Introduction
In data mining, most traditional systems focus on propositional patterns within a single table. However, real-world data is inherently relational, distributed across multiple tables. Metaquerying uses templates to find rules that link these tables. For example, a metaquery might seek to find if a student's performance in a course is related to their department. While powerful, metaquerying is computationally expensive. This paper explores the theoretical complexity of metaquerying and proposes algorithmic improvements to make it viable for large-scale databases.
The Challenges of Metaquerying
The authors identify three primary obstacles in existing metaquerying research:
- Computational Complexity: The paper formally establishes that answering a metaquery is NP-Hard, proving it equivalent to finding a Hamiltonian Path in a graph.
- Unstable Metrics: Traditional definitions of "support" (the frequency of a rule) often vanish as the database grows, making relevant rules appear statistically insignificant.
- Join Efficiency: Discovering patterns requires performing massive joins across tables, a process that is notoriously slow and resource-intensive.
Redefining Support for Relational Data
To address the metric instability, the authors propose a new definition of support. Instead of a global measure, support is defined as the maximum fraction of any single relation participating in the rule. This "local" definition ensures that a rule remains statistically significant even as unrelated data is added to the database, providing a more stable and intuitive measure for relational discovery.
Algorithmic Framework
The discovery process is divided into two main stages:
- Instantiation Stage: The system searches for matching tables using a Constraint Satisfaction Problem (CSP) approach. Techniques like forward checking and back-jumping are employed to find valid table combinations efficiently.
- Filtration Stage: Potential rules are filtered based on support and confidence thresholds. To avoid the "Join-first" bottleneck, the authors introduce a pruning mechanism.
As shown in the compute-support algorithm, the system calculates an upper bound for support. If this bound is below the user-defined MinSupport, the rule is discarded immediately, bypassing the expensive join operation.
Histogram-Based Estimation
The core innovation for speeding up filtration is the use of histograms. By analyzing the distribution of attribute values (e.g., the number of students per department) rather than raw data, the system can estimate the size of a join with high accuracy and minimal cost.
The authors propose two methods for calculating these upper bounds: "brave" and "cautious."
The "brave" approach uses a single common variable to estimate the bound, while the "cautious" approach considers all common variables to find the tightest possible bound. Additionally, a "Histogram + Memory" approach caches these estimates to avoid redundant calculations when table pairs are reused across different rules.
Empirical Evaluation
The algorithms were tested on the Studentgrades database (approx. 24,000 total rows across four tables). Key results include:
- Performance: The histogram-based method achieved a 50% reduction in execution time compared to standard join-first approaches.
- Scalability: Efficiency improved as the support threshold increased, as higher thresholds allow for more aggressive pruning of the search space.
- Caching: Memory optimization provided significant benefits in complex queries where table pairs appeared frequently.
Conclusion and Future Work
This research demonstrates that while metaquerying is theoretically difficult, practical optimizations can make it highly efficient. By redefining support and using histogram-based pruning, the authors significantly lower the barrier for relational data mining. Future work will focus on empirical testing of the "cautious" upper-bound variant and developing similar estimation shortcuts for "confidence" metrics to further streamline the discovery pipeline.
Summary updated