We consider data-visualization systems where a middleware layer translates a frontend request to a SQL query to a backend database to compute visual results. We study the problem of answering a visualization request within a limited time constraint due to the responsiveness requirement. We explore the optimization options of rewriting an original query by adding hints and/or doing approximations so that the total time is within the time constraint. We develop a novel middleware solution called Maliva based on machine learning (ML) techniques. It applies the Markov Decision Process (MDP) model to decide how to rewrite queries and uses training instances to learn an agent to make a sequence of decisions judiciously for an online request. We give a full specification of the technique, including how to construct an MDP model, how to train an agent, and how to use approximating rewrite options. Our experiments on both real and synthetic datasets show that Maliva performs significantly better than a baseline solution that does not do any rewriting, in terms of both the probability of serving requests interactively and query execution time.
翻译:我们考虑的是数据可视化系统,其中中器层将前端请求转换成 SQL 查询到后端数据库,以计算视觉结果。我们研究了在因响应要求而导致的有限时间限制内回答可视化请求的问题。我们探索了重写原始查询的最优化选项,即添加提示和(或)做近似,以使总时间在时间限制之内。我们开发了一个新型的中器解决方案,即基于机器学习(ML)技术的马里瓦。我们使用Markov 决策程序模型来决定如何重写查询,并利用培训实例来学习一个代理来明智地为在线请求做出一系列决定。我们给出了技术的全部规格,包括如何构建一个 MDP 模型,如何培训一个代理,以及如何使用相近的重写选项。我们在真实和合成数据集上的实验显示,马里瓦在互动和询问执行时间的概率方面比一个不做重写工作的基线解决方案要好得多。