Large-scale predictive modeling and analytics through regression queries in data management systems

Christos Anagnostopoulos, Peter TriantafillouInt. J. Data Sci. Anal 2020

Overview

Predictive Modeling and Analytics (PMA) is a cornerstone of modern data science, but it faces a massive scalability wall in traditional Data Management Systems (DMS). This paper introduces a novel statistical learning framework that performs piecewise linear regression (PLR) by observing only the results of past queries, rather than scanning raw data. By training on query-answer pairs, the system achieves up to six orders of magnitude speedup in predictive analytics with sub-millisecond latencies, even on datasets containing billions of records.

The Scalability Challenge

In traditional DMS, running a linear regression query involves two expensive steps: identifying a specific data subspace (e.g., "all sensor readings within a specific geographic region") and then calculating regression coefficients over those points. As datasets grow into the billions of rows, these operations become prohibitively slow. Standard algorithms like Ordinary Least Squares (OLS) scale poorly with the number of data points ($n$), and more complex models like Piecewise Linear Regression (PLR)—which are better at capturing non-linear trends—are even more computationally taxing.

Methodology: Query-Driven Piecewise Linear Regression

The authors propose a Query-driven Piecewise Linear Regression model. Instead of looking at raw table rows, the model treats the DMS as a "black box" and learns from the stream of past queries ($q$) and their responses ($y$).

Key components include:

  • Adaptive Vector Quantization (AVQ): An unsupervised technique to partition the high-dimensional query space into $K$ local subspaces, growing dynamically based on query stream complexity.
  • Query-LLM (Local Linear Mapping): Within each partition, the model uses Stochastic Gradient Descent (SGD) to estimate a local linear approximation of the query function.
  • Data-LLM Derivation: A mathematical contribution showing how to derive the underlying data function from these query-level approximations.
Piecewise linear regression (PLR) approximations for 1D and 2D data functions.

Key Insights: The "Query-as-Data" Shift

The most profound idea is that the history of user interaction with a database contains enough statistical "signal" to reconstruct the underlying data distribution. We don't need to touch the disk if we've seen enough similar queries before.

Visualization of local vs. global regression planes on a complex surface.

By using a piecewise approach driven by quantization, the model "discovers" the boundaries where data trends change, providing much higher accuracy than standard global regression tools. Once the model is trained, the time to predict a regression result is $O(1)$ relative to the database size, maintaining sub-millisecond latency regardless of whether the table has a million or a trillion rows.

Experimental Results

The methodology was evaluated on three large-scale datasets: a real-world gas sensor array (15 million vectors), a massive synthetic Rosenbrock function (up to 10 billion vectors), and appliance energy data (10 million vectors).

  • Speed: The model achieved execution times of approximately 0.18 ms to 0.78 ms per query, representing a six-order-of-magnitude speedup (10^6x faster) over exact solutions in PostgreSQL or MATLAB.
  • Accuracy: Predicted answers were highly accurate, often outperforming global regression models because the piecewise approach captured local non-linearities that global models missed.
  • Efficiency: The model converged after seeing only a few thousand query-answer pairs, a tiny fraction of the total data points available in the massive datasets.

Conclusion

This query-driven framework breaks the dependency on dataset size for predictive analytics. While currently focused on mean-value and linear regression queries, it paves the way for high-speed analytics on massive, static datasets. Future work will explore expanding to more complex analytical operators and handling high-velocity data updates where the underlying distribution shifts rapidly.

Summary updated

BibTeX
@article{anagnostopoulos2020large,
  author = {Christos Anagnostopoulos and Peter Triantafillou},
  title = {{Large-scale predictive modeling and analytics through regression queries in data management systems}},
  journal = {Int. J. Data Sci. Anal.},
  year = {2020},
  doi = {10.1007/s41060-018-0163-5},
}
Figure