Optimizing an aggregate join query

Structured Query Language (SQL) is a standardized language for accessing and updating relational databases. SQL provides a mechanism for creating and maintaining tables, each of which contains rows and columns of information that are collectively assembled into a database. Ideally, the tables are &q...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: Au, Grace Kwan-On
Format: Patent
Sprache:eng
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:Structured Query Language (SQL) is a standardized language for accessing and updating relational databases. SQL provides a mechanism for creating and maintaining tables, each of which contains rows and columns of information that are collectively assembled into a database. Ideally, the tables are "normalized" in that the structure of the tables avoids data redundancy and allows the resulting data model to be mapped to many different physical database designs. In order to avoid redundancy, yet still be able to display data from multiple tables, SQL provides a mechanism called a "join." A method and computer system for optimizing queries to a database are disclosed. The query specifies one or more data-to-be-aggregated columns (DAC), one or more explicit aggregation keys (EAK) and one or more join conditions. The query involves table T. Tincludes the one or more data-to-be-aggregated columns and an aggregation key. All join conditions that involve Tjoin the aggregation key of Tto the unique primary index of another table that is involved in the query. Tis joined to a table Tin accordance with a join condition of the aggregate join query. The joining process includes sorting Ton a sort key that is the aggregation key. Aggregation processing is combined into the step of sorting if Tis a significant table. Aggregation processing is also combined into the step of sorting if Tis a significant table and the first join condition is between the aggregation key of Tand the unique primary index of T