Abstract
We propose a practical alternative to state-of-the-art query processing called "Query Mesh" (QM). QM computes multiple routes (query plans), each tailored to data subsets with distinct statistical properties. A classifier model partitions incoming data tuples to assign the optimal route. We demonstrate QM in a streaming context via the "Ubi-City" application, showcasing integrated machine learning optimization, the "Self-Routing Fabric" execution infrastructure, and near-zero overhead online adaptation.
Introduction: The Middle Ground of Query Optimization
Traditional query optimizers typically adopt a "one-size-fits-all" approach, selecting a single execution plan based on global dataset statistics. However, real-world data streams—such as stock market feeds or sensor networks—often exhibit significant internal variance. A plan optimized for one subset may be highly inefficient for another. Conversely, "tuple-at-a-time" optimizers like Eddies provide extreme flexibility but incur prohibitive per-tuple routing overhead.
Query Mesh (QM) occupies the middle ground. It leverages machine learning to route data subsets through specialized plans, achieving fine-grained performance without the crushing cost of continuous re-optimization.
System Architecture
The QM framework integrates three primary components into a Data Stream Management System (DSMS): the Optimizer, the Executor, and the Adaptor.
- QM Optimizer: Operates offline to identify multiple specialized "routes" using cost-based heuristics. It then trains a decision tree classifier to map tuple characteristics to the most efficient route.
- QM Executor: Handles runtime processing. It consists of an Online Classifier that tags tuples with route labels and a Self-Routing Fabric (SRF) that executes them.
- QM Adaptor: Monitors for "concept drift." When data distributions shift, it swaps the active classifier for a more accurate one with near-zero runtime overhead.
Efficient Execution via Self-Routing Fabric
The core innovation in QM execution is the decentralization of routing logic. Rather than relying on a central controller, QM uses "r-tokens"—metadata itineraries embedded directly into the data stream.
As shown in the figure above, the Online Classifier assigns an r-token to each tuple. The SRF contains an array of operator modules. Each operator simply "pops" its instruction from the r-token and forwards the tuple to the next destination. This "fabric" approach allows different tuples to follow different execution paths concurrently without interference or centralized bottlenecks.
Demonstration: The Ubi-City Application
The QM framework is evaluated using Ubi-City, a simulation of a ubiquitous computing environment. It generates continuous GPS data for vehicles and pedestrians in Worcester, MA. The demo highlights how QM handles complex queries involving spatial distances and security punctuations, which naturally create distinct data subsets requiring different processing strategies.
Key Insights and Results
- Practicality: QM avoids the "route discovery" costs of fully dynamic systems while outperforming static single-plan systems on non-uniform data.
- Scalability: The decentralized SRF ensures that the system can scale with complex multi-route plans.
- Adaptability: The system handles "hybrid concept drift" by decoupling the physical operator infrastructure from the routing logic (the classifier).
Limitations and Future Work
While promising, QM faces challenges in managing the combinatorial explosion of the route search space, which is NP-hard. Future work will focus on more robust heuristics for route selection and investigating the memory overhead of maintaining numerous concurrent specialized plans in highly complex environments.
Summary updated