TL;DR
This paper tackles the challenge of efficiently querying massive, raw datasets by intelligently deciding which data to load into a database. They propose a novel workload-driven approach that models this as a binary vertical partitioning problem, offering both an NP-hard optimization formulation and a practical, fast heuristic. Their method significantly outperforms existing techniques by considering the entire query workload, leading to substantial improvements in query execution time.
What Problem Does This Paper Address?
The explosion of "Big Data" presents a significant challenge for traditional database systems. These systems typically require a strict schema definition and data loading process before any queries can be executed. While "raw data processing" (schema-on-demand) offers a way to access data without upfront loading, existing methods often process queries in isolation. This leads to suboptimal performance when dealing with a workload of queries, as data loading decisions are made greedily for each query, potentially wasting storage and processing time on attributes that are rarely used across the entire workload. This paper addresses the problem of workload-driven raw data processing with partial loading, aiming to find the optimal subset of data to load into a database to minimize the overall execution time for a given set of queries.
Methods
The core of the paper lies in modeling the problem and developing solutions.
- MIP Formulation: They formulate the problem as a Mixed Integer Programming (MIP) optimization problem. This involves defining variables for data loading decisions (savej) and query execution (readij), along with constraints that capture storage limitations and data access dependencies. The objective is to minimize the total query workload execution time. They prove this formulation is NP-hard, meaning finding an exact optimal solution is computationally intractable for large datasets.
- Two-Stage Heuristic: To overcome the NP-hardness, they design a two-stage heuristic algorithm.
- Query Coverage: This stage prioritizes loading attributes that cover entire queries, aiming to eliminate raw data access for as many queries as possible. It uses a greedy approach to maximize the number of covered queries within the storage budget.
-
Attribute Usage Frequency: This stage focuses on loading individual attributes that are frequently used across queries, especially those that are CPU-intensive to extract. This complements query coverage by addressing attributes that might not form complete query coverage but are still important. The heuristic combines these two stages, intelligently allocating the storage budget between them to achieve a good balance.
-
Pipelined Processing Extension: They extend their MIP formulation and heuristic to handle pipelined raw data processing, where data access and extraction can occur concurrently. This introduces complexities due to the
maxfunction in the objective, but they adapt their heuristic to effectively handle this scenario.
Datasets
The paper evaluates their approach using three real-world data formats:
- CSV: Delimited text files.
- FITS: Binary format commonly used in astronomy.
- JSON: Semi-structured key-value format, exemplified by Twitter API data.
They use the Sloan Digital Sky Survey (SDSS) dataset for CSV and FITS, specifically the photoPrimary table (5 million rows, 509 attributes). For JSON, they use Twitter API data (5.42 million tweets, up to 155 attributes). Workloads are derived from actual SDSS queries and synthetically generated for Twitter data.
Key Insights and Ideas
- Workload Matters: The most significant insight is that considering the entire query workload for data loading decisions is crucial for optimizing raw data processing, unlike previous query-by-query approaches.
- Binary Vertical Partitioning Equivalence: The problem of partial loading can be effectively modeled as a binary vertical partitioning problem, where one partition is the raw data and the other is the loaded, processed data.
- Heuristic Synergy: The two-stage heuristic (Query Coverage + Attribute Usage Frequency) demonstrates that combining different optimization strategies (query-centric vs. attribute-centric) yields better results than either strategy alone.
- Pipelining Complexity: Pipelined processing introduces non-linearity that makes direct MIP solving harder, necessitating heuristic adaptations.
- Data Format Adaptability: The proposed model and heuristic are shown to be generalizable across different data formats (CSV, FITS, JSON), highlighting the robustness of their approach.
Key Results
- Heuristic Performance: The proposed two-stage heuristic achieves results that are "within close range of the optimal solution" in a "fraction of the time" compared to solving the NP-hard MIP formulation.
- Execution Time Improvement: The heuristic significantly outperforms existing vertical partitioning algorithms and even CPLEX (an optimization solver) in terms of execution time, often by orders of magnitude.
- Accuracy: The heuristic demonstrates superior accuracy compared to other vertical partitioning algorithms, especially for serial processing. For pipelined processing, it achieves the best accuracy across various storage budgets.
- Model Validation: The MIP formulation accurately models the execution behavior of raw data processing for CSV, FITS, and JSON formats, with "almost complete overlap" in validation plots.
Limitations and Future Work
- NP-Hardness: The core problem is NP-hard and inapproximable, meaning optimal solutions are computationally infeasible for large instances. The heuristic provides a practical trade-off.
- Offline Loading: The current work focuses on offline loading (decisions made before query execution). The authors suggest extending this to online loading, where loading and query processing are intertwined, and queries might arrive one at a time.
- Atomic Attribute Loading: The current model assumes loading entire attributes. Future work could explore loading portions of attributes (horizontal partitions).
- Multi-Query Sharing: The paper could be extended to consider environments where raw data access and attribute extraction can be shared across multiple queries simultaneously.
Summary updated