Abstract
Materialized views are essential for high-performance data warehousing, yet their maintenance poses significant challenges. This paper explores the practical performance trade-offs of incremental maintenance versus full recomputation. By evaluating various data representations and update algorithms within the WHIPS prototype, the study identifies critical factors—such as SQL optimizer limitations and duplicate handling—that dictate the efficiency of warehouse updates.
Introduction
Data warehouses integrate information from diverse sources into materialized views to facilitate rapid decision support. As source data evolves, these views must be updated to remain consistent. The traditional method of full recomputation, while simple, becomes prohibitively expensive as datasets scale. Incremental maintenance offers a more efficient alternative by applying only the changes (deltas) to the existing view. However, implementing incremental maintenance involves complex architectural choices regarding duplicate handling, update granularity, and concurrency control. This paper systematically evaluates these choices using commercial database management systems (DBMS).
Methodology
The research utilized the WHIPS (WareHouse Information Processing System) prototype to test several key implementation strategies:
View Representation
A fundamental choice in view maintenance is how to handle duplicate rows (bag semantics). The authors compared two primary representations:
duprepresentation: Every duplicate row is stored explicitly.cntrepresentation: Unique rows are stored alongside adupcntattribute indicating their frequency.
Delta Installation and Aggregation
The study examined different methods for applying deltas. GenInstall provides a general update mechanism, while KeyInstall leverages primary key information for optimization. Crucially, the authors compared cursor-based loops (row-by-row updates) against set-based SQL statements (batch updates).
For aggregate maintenance, four algorithms were evaluated:
- FullRecomp: The baseline full recomputation.
- SDcursor: A traditional summary-delta algorithm using cursors.
- SDbatch: A novel approach that processes deletions and insertions in batches to minimize lock duration.
- SDoverwrite: An algorithm designed for near-zero downtime by computing updates in a separate table before swapping.
Experimental Setup
Experiments were conducted using the TPC-D benchmark on scale factors ranging from 0.1 (~100MB) to 1.0 (~1GB), focusing on the Lineitem and Order tables within a commercial relational DBMS environment.
Analysis of Performance Trade-offs
The experiments revealed several non-intuitive insights into DBMS performance:
The Optimizer Gap
A significant finding was the failure of commercial SQL optimizers to efficiently handle complex DELETE statements involving correlated subqueries. In many scenarios, a "primitive" cursor-based loop that deletes rows individually outperformed high-level, set-based SQL statements. This suggests that the theoretical benefits of set-oriented processing are often undermined by current optimizer implementations.
Duplicate Handling and Scalability
The cnt representation proved superior for datasets with high multiplicity. While the maintenance time for the dup representation grows linearly with the number of duplicates, the cnt representation remains relatively constant. However, the cnt approach introduces overhead for simple projections, as it requires a GROUP BY operation to maintain correct counts.
Availability and Locking
Beyond raw speed, the authors emphasized locking time—the duration a view is inaccessible to users. The proposed SDbatch and SDoverwrite algorithms significantly reduced downtime compared to traditional methods, highlighting the importance of concurrency-aware maintenance strategies.
Key Results
- Incremental Speedup: For large tables, incremental algorithms were orders of magnitude faster than full recomputation.
- Batch vs. Cursor: Set-based SQL batching became faster for insertions once update volume exceeded 1%. For deletions, cursor-based methods remained more efficient due to optimizer limitations.
- Aggregation Ratios: The benefit of incremental maintenance is most pronounced when the "aggregation ratio" is high (i.e., the view is significantly smaller than the base data).
Conclusion and Future Work
The study demonstrates that incremental maintenance is generally superior to full recomputation, but its effectiveness is highly sensitive to implementation details and underlying DBMS behavior. Future work should address the limitations of incremental methods for non-algebraic aggregates like MIN and MAX. As DBMS vendors improve support for warehouse-specific operations like "upserts" and subquery optimization, the balance may shift further toward pure SQL-based maintenance strategies.
Summary updated