nD-SQL: A Multi-Dimensional Language for Interoperability and OLAP

Frédéric Gingras, Laks V. S. LakshmananVLDB 1998

Introduction

nD-SQL is a powerful extension of SQL designed to query across federated databases that possess heterogeneous schemas. By treating metadata—such as table and column names—as first-class data, it enables complex restructurings and multi-dimensional Online Analytical Processing (OLAP) aggregations, such as CUBE and ROLLUP, directly across disparate sources without requiring a pre-integrated data warehouse.

The Challenge of Schematic Discrepancy

In the late 1990s, while data warehousing was the standard for decision support, the process of building one remained slow and expensive. Organizations frequently developed "data marts"—isolated pockets of data that lacked interoperability. The primary obstacle was schematic discrepancy. For instance, in a stock market federation, one database might store "IBM" as a value in a Ticker column, while another might name a column IBM, and a third might dedicate an entire table to IBM.

Standard SQL struggles to "cross-query" these varied structures. Furthermore, performing OLAP, which requires aggregating data at multiple levels of granularity, is nearly impossible when dimensions are trapped in different schema components (rows vs. columns vs. table names).

The nD-SQL Solution

The authors propose a three-pronged solution to bridge these gaps:

  1. A Formal Model: A federation model that treats the relational model as having three physical dimensions: row, column, and relation. This allows n-dimensional data to be mapped onto physical structures symmetrically.
  2. nD-SQL Language: An extension of SQL introducing schema variables that range over database, relation, or column names. It includes HASA and ISA keywords for filtering and a FOR subclause in the SELECT statement to dynamically restructure data.
  3. Restructuring Relational Algebra (RRA): A mathematical foundation extending classical relational algebra with operators like ADD_COL and ADD_REL to optimize queries that modify their own schema during execution.
Metadata represented as first-class data in nD-SQL, showing criteria like Ticker and Measure treated as values.

Key Insights and Algebraic Optimization

The core insight of nD-SQL is the symmetry between data and metadata. The distinction between a value in a row and a column header is often arbitrary. By recognizing three physical dimensions (rows, columns, and tables), nD-SQL allows users to "rotate" data between these dimensions, similar to a generalized pivot table.

To ensure semantic soundness, the authors introduced "well-typing" for metadata queries, preventing meaningless operations like summing table names. Furthermore, the RRA allows restructuring operations to commute with standard operations like joins and filters, enabling the system to "push" filters to remote databases for improved performance.

OLAP Integration and Results

nD-SQL demonstrates significant expressive power, performing restructurings impossible in standard SQL without external host languages. It seamlessly integrates OLAP by expressing CUBE operations and visualizing results across multiple physical formats simultaneously.

Lattice of cuboids representing the multi-dimensional aggregation levels supported by nD-SQL's OLAP integration.

The implementation of an nD-SQL server on Windows 95 using Visual C++ proved the viability of the RRA-based architecture for real-world middleware.

Conclusion and Future Work

While nD-SQL provides a robust framework for interoperability, future work remains in handling dimension hierarchies (e.g., Day to Month rollups) and interleaving partial cube computations with restructuring operations. Despite these limitations, nD-SQL represents a major step toward flexible, federated multi-dimensional querying.

Summary updated

BibTeX
@inproceedings{gingras1998nd,
  author = {Frédéric Gingras and Laks V. S. Lakshmanan},
  title = {{nD-SQL: A Multi-Dimensional Language for Interoperability and OLAP}},
  booktitle = {VLDB},
  year = {1998},
}
Figure