TL;DR
Microsoft's Hyperspace is a novel indexing subsystem for Azure Synapse Analytics that automatically accelerates queries on data lakes without requiring application code changes. It achieves this by building and managing secondary indexes in a serverless, scalable manner, significantly improving query performance for enterprise workloads.
What Problem Does This Paper Address?
The convergence of data lakes and data warehouses presents a challenge: how to efficiently query and accelerate diverse data formats at scale while also managing updates and ensuring data governance. Traditional databases offer robust indexing, but applying these concepts to massive, distributed data lakes is complex. Users often resort to creating numerous derived datasets, manually optimizing pipelines, and managing complex lifecycles, leading to significant overhead and potential errors. This paper addresses the need for a unified, automated, and user-friendly indexing solution that bridges the gap between data lakes and warehouses, simplifying query acceleration and index management for enterprise users.
Methods
Hyperspace introduces a serverless indexing subsystem built on Apache Spark. Key methodological contributions include:
- Format-Agnostic Indexing: Hyperspace can index various data formats (CSV, JSON, Parquet) and is extensible to support new ones.
- Columnar Index Storage: Indexes are stored in a columnar format (Parquet), leveraging optimizations like min-max pruning for efficient scans.
- Hash-Partitioned & Sorted Indexes: Indexes are hash-partitioned and optionally sorted by index columns, enabling efficient point lookups and avoiding shuffles in join operations.
- Serverless Index Management: Index metadata and operations are stored in the data lake, eliminating the need for dedicated index management servers and enabling multi-engine interoperability and multi-user concurrency.
- Optimistic Concurrency Control: A robust concurrency model ensures correctness during concurrent index manipulations.
- Index-Aware Query Optimizer: Hyperspace integrates with Spark's Catalyst optimizer, automatically rewriting queries to leverage available indexes without user intervention.
- Hybrid Scan: A novel operator that allows queries to utilize "stale" indexes by applying changes observed in the underlying data, providing acceleration even when indexes are not perfectly up-to-date.
- Index Recommendation & "What-If" Utility: Tools to help users identify and analyze the potential benefits of creating specific indexes for their workloads.
Datasets
The paper evaluates Hyperspace using:
- TPC-H: A standard industry benchmark for decision support systems (22 queries).
- TPC-DS: Another industry benchmark for decision support systems (99 queries).
- Customer Workload: A real-world customer dataset (15 queries).
These datasets were used to evaluate index creation time, query execution performance, and the efficiency of the hybrid scan mechanism.
Key Insights and Ideas
- Automated Indexing is Crucial for Enterprise Adoption: The success of data lake analytics hinges on simplifying complex tasks. Hyperspace's automatic index utilization and management are key to making advanced performance optimizations accessible to a wider audience.
- Serverless Index Management is a Game-Changer: By storing metadata in the data lake, Hyperspace removes operational burdens and dependencies, making it easier to deploy and manage at scale.
- Hybrid Scan Bridges the Gap Between Performance and Freshness: The ability to leverage stale indexes significantly improves usability and performance in dynamic data environments, a critical feature for real-world enterprise scenarios.
- Extensibility is Key: Hyperspace's design allows for the integration of various index types beyond traditional ones, making it a flexible platform for future advancements.
Key Results
- Hyperspace can accelerate query execution by up to 10x on industry benchmarks and up to two orders of magnitude in certain real-world workloads.
- Specific gains observed include:
- 40% to 75% speedup for TPC-H.
- 50% speedup for TPC-DS.
- 44% to 94% speedup for the Customer workload.
- The hybrid scan mechanism provides significant acceleration, often approaching the performance of fully up-to-date indexes, even with substantial data updates. For instance, in scenarios with small numbers of updates relative to the base dataset size, hybrid scan performance is close to fully refreshed indexes.
Limitations and Future Work
- External Consistency: Hyperspace does not manage the underlying data, so ensuring external consistency (i.e., that the index is up-to-date with the data at the exact moment of query execution) remains a challenge that requires coordination among data lake users.
- Index Creation Time: While linear speedup is observed with more cores, index creation itself is noted as an area for further improvement, as it involves scanning, repartitioning, and writing data.
- Automatic Hybrid Scan Threshold: The paper mentions that automatically determining when to disable hybrid scan due to excessive staleness is left for future work.
- Index Optimization for Aggregates: The paper suggests that Hyperspace indexes could be beneficial for aggregate operators on top of group-bys, which is a direction for future research.
- Integration with Other Index Types: While Hyperspace is extensible, further work is needed to seamlessly integrate and optimize the use of various advanced data structures as indexes.
Summary updated