Abstract
Aditi is a disk-based, multi-user deductive database system developed at the University of Melbourne. It was designed to integrate the expressive power of logic programming with the performance and scalability of industrial-strength relational databases. By employing a parallel, client-server architecture and advanced compiler optimizations such as Magic Sets and Context Transformations, Aditi demonstrates that complex recursive queries can achieve performance levels comparable to traditional SQL-based systems.
Introduction
In the early 1990s, database researchers faced a significant "impedance mismatch." Relational Database Management Systems (RDBMS) were highly efficient at managing large-scale data on disk but lacked the expressive power to handle deep recursion and complex, nested data structures. Conversely, logic programming environments like Prolog excelled at recursion and symbolic manipulation but were typically memory-bound and lacked the multi-user, persistent storage features required for industrial applications.
The Aditi project was initiated to bridge this gap. The goal was to build a system capable of handling "non-atomic" data (e.g., nested lists and function symbols) and complex recursive queries while maintaining the performance, concurrency, and disk-management capabilities of a standard RDBMS.
Architecture
Aditi utilizes a sophisticated multi-process client-server architecture designed for high concurrency and performance on shared-memory multiprocessors. The system is divided into several distinct process types:
- User Interface (UI): The front-end through which users interact with the system.
- Database Access Processes (DAP): One DAP is spawned per client. It handles authentication, manages query evaluation, and coordinates with other system components.
- Relational Algebra Processes (RAP): These are the "workhorses" of the system, responsible for executing fundamental relational operations such as joins, unions, and projections.
- Query Server (QS): A central load balancer that manages the pool of available RAPs, assigning tasks to ensure efficient resource utilization.
This decoupling allows Aditi to execute different parts of a query in parallel. To minimize overhead, Aditi uses shared memory for "in-core" temporary relations, avoiding the latency associated with creating temporary files on disk—a technique that yielded a 4x speedup in query processing.
Optimization and Evaluation Strategies
Aditi's performance stems from its hybrid approach to query evaluation and its advanced compiler optimizations.
Bottom-Up Evaluation and Hybrid Execution
Unlike standard Prolog, which uses top-down evaluation, Aditi primarily employs bottom-up, set-at-a-time evaluation. This approach is generally more efficient for large-scale data processing. However, recognizing that certain tasks (like list manipulation) are inefficient in a set-at-a-time model, Aditi embeds a NU-Prolog interpreter to handle specific predicates top-down.
Compiler Transformations
The Aditi-Prolog compiler automatically applies source-to-source transformations to prune the search space of recursive queries. Two primary techniques are used:
- Magic Sets: The industry standard for optimizing recursive queries by restricting the computation to relevant tuples.
- Context Transformations: An alternative strategy that the authors found to be superior for linear recursion, as it avoids the overhead of managing auxiliary "magic" relations.
Advanced Indexing
Beyond standard B-trees, Aditi introduces Superimposed Codeword Indexing (SSIMC and DSIMC). These custom hashing schemes are designed for efficient partial-match queries, proving to be up to 30 times faster than B-trees when the first attribute of a key is not specified in the query.
Performance Evaluation
The system was evaluated using two primary benchmarks: synthetic path queries on large binary trees and the "Phileas Fogg" flight database.
- Optimization Impact: On large graph datasets, optimized queries were over 1,300 times faster than untransformed versions (e.g., 2.2 seconds vs. 51 minutes for a tree of depth 14).
- Context vs. Magic: In the flight database tests, Context Transformation consistently outperformed Magic Sets by 20% to 40% for linear recursive queries.
- Scalability: Aditi demonstrated excellent scalability; as input data grew 100-fold, execution time for optimized queries only increased by a factor of 20 to 35.
Conclusion and Future Work
Aditi successfully demonstrated that deductive databases could achieve industrial-level performance. While the initial version had limitations—such as the lack of a robust transaction mechanism and support only for stratified negation—it laid the groundwork for future research in logic-based data management. Future directions for the project included the integration of object-oriented features, support for distributed memory, and more sophisticated type systems to further enhance data handling and optimization.
Summary updated