Algorithms for Materialized View Design in Data Warehousing Environment

Jian Yang, Kamalakar Karlapalem, Qing Li

Abstract

In data warehousing, selecting which intermediate results to materialize is a critical decision that balances query performance against view maintenance costs. This paper introduces the Multiple View Processing Plan (MVPP) framework to model these dependencies. We propose two primary algorithmic approaches: a fast heuristic for selecting views from a given MVPP and a 0-1 integer programming formulation to determine the optimal global MVPP structure. Our analysis shows that a global optimization strategy, which may favor sub-optimal individual query plans to maximize sharing, can significantly reduce total system costs compared to traditional methods.

Introduction

Data warehouses support complex analytical queries over massive datasets. To ensure acceptable response times, administrators often use materialized views—pre-computed query results stored on disk. However, materialization presents a fundamental tradeoff: while storing all final results maximizes read performance, the cost of updating these views as base data changes can become prohibitive. Conversely, materializing nothing minimizes maintenance but results in slow, repetitive computations.

The optimal strategy involves materializing "shared" intermediate results—common subexpressions utilized by multiple queries. This paper addresses the challenge of identifying these results by considering both query access frequencies and base relation update rates.

The Multiple View Processing Plan (MVPP)

The authors formalize the view selection problem using a Multiple View Processing Plan (MVPP). An MVPP is a directed acyclic graph where leaf nodes represent base relations, root nodes represent final queries, and intermediate nodes represent relational algebra operations such as joins or projections.

Figure 1: A Multiple View Processing Plan (MVPP) illustrating the flow from base relations to multiple queries (Q1-Q4) with shared intermediate nodes.

In this framework, the goal is to select a subset of nodes in the MVPP to materialize such that the total cost—the sum of query processing costs and view maintenance costs—is minimized.

Optimization Strategies

The paper proposes two distinct stages of optimization:

  1. View Selection (HAMVD): Given a fixed MVPP, the Heuristic Algorithm for Materialized View Design (HAMVD) determines which nodes to materialize. It calculates a weight for each node based on the processing time saved across all queries minus the maintenance overhead. It employs a top-down traversal to select nodes with positive net savings.
  2. MVPP Generation: Since a single query can have multiple valid execution plans (e.g., different join orders), the choice of MVPP itself is a variable.
  3. Heuristic Approach (HAmvpp): This algorithm merges the optimal individual plans for each query into a single MVPP based on shared join patterns. While efficient ($O(n)$), it is limited by the initial choice of individual plans.
  4. 0-1 Integer Programming (IP): To achieve a true global optimum, the authors formulate the selection of the best MVPP from all possible join trees as a 0-1 IP problem. This approach recognizes that a sub-optimal plan for one query might be globally beneficial if it enables significant sharing with others.

Global vs. Local Optimization

A central insight of this work is that individual query optimization does not necessarily lead to global system optimization. In a multi-query environment, it is often more efficient to use a slightly slower join order for one query if that order produces an intermediate result that can be reused by another query.

Figure 2: Alternative query plans and the identification of shared sub-plans for global optimization.

Furthermore, the authors emphasize that Multiple Query Optimization (MQO) techniques, which focus solely on simultaneous execution, are insufficient for data warehousing. Materialized view design must account for the asynchronous nature of updates. A view that is highly shared but derived from frequently updated base tables may be too costly to maintain, regardless of its query benefits.

Performance Analysis

Using a synthetic motivating example, the authors demonstrate the effectiveness of their approach. The study compared three strategies:

  • Materializing everything: Yielded the best query performance but the highest maintenance cost, resulting in a total cost of ~175,386 million units.
  • Materializing nothing: Yielded zero maintenance cost but poor query performance, with a total cost of ~8 billion units.
  • Selective materialization: Using the authors' algorithms to materialize key shared intermediate nodes dropped the total system cost to ~85,407 million units—less than half the cost of materializing all final views.

While the 0-1 IP approach provides a mathematically optimal solution, its exponential complexity ($O(2^n)$) remains a challenge for very large schemas. Future work includes integrating index selection into the cost model and applying these algorithms to real-world database migration scenarios.

Summary updated

BibTeX
@inproceedings{yang1997algorithms,
  author = {Jian Yang and Kamalakar Karlapalem and Qing Li},
  title = {{Algorithms for Materialized View Design in Data Warehousing Environment}},
  booktitle = {VLDB},
  year = {1997},
}
Figure