🌙

利用共享子表达式和物化视图复用进行多查询优化

Exploiting Shared Sub-Expression and Materialized View Reuse for Multi-Query Optimization

Information Systems Frontiers · 2024
被引 1
ABS 3

中文导读

研究了一种混合多查询优化方法,结合批处理(共享子表达式)和缓存(物化视图复用)技术,实验表明在查询相似度高且缓存充足时,相比单独使用MQO技术可提速4倍,但某些情况下也可能降速2倍。

Abstract

Abstract Querying in isolation lacks the potential of reusing intermediate results, which ends up wasting computational resources. Multi-Query Optimization (MQO) addresses this challenge by devising a shared execution strategy across queries, with two generally used strategies: batched or cached . These strategies are shown to improve performance, but hardly any study explores the combination of both. In this work we explore such a hybrid MQO, combining batching (Shared Sub-Expression) and caching (Materialized View Reuse) techniques. Our hybrid-MQO system merges batched query results as well as caches the intermediate results, thereby any new query is given a path within the previous plan as well as reusing the results. Since caching is a key component for improving performance, we measure the impact of common caching techniques such as FIFO, LRU, MRU and LFU. Our results show LRU to be the optimal for our usecase, which we use in our subsequent evaluations. To study the influence of batching, we vary the factor - - which represents the similarity of the results within a query batch. Similarly, we vary the cache sizes to study the influence of caching. Moreover, we also study the role of different database operators in the performance of our hybrid system. The results suggest that, depending on the individual operators, our hybrid method gains a speed-up between 4x to a slowdown of 2x from using MQO techniques in isolation. Furthermore, our results show that workloads with a generously sized cache that contain similar queries benefit from using our hybrid method, with an observed speed-up of 2x over sequential execution in the best case.

数据库查询优化物化视图缓存技术多查询处理