Patent Document ID: 8122033
Application ID: 11971525

Base Claim:
1. In a computer system having a relational database system, a method comprising: creating a number of materialized query tables (MQTs) within the database system; defining one or more database table specifications, including a primary key of a table for a number of tables; receiving an incoming query at the database system; in response to the incoming query referencing a first subset of a set of tables, identifying an MQT with a definition query that references the set of tables, wherein said first subset includes one of: (a) a number of fact tables and a group of dimension tables; (b) a number of source tables and a group of dependent tables; and (c) a number of referencing tables and a group of referenced tables; determining when the MQT is a candidate match for the incoming query; identifying one or more candidate MQTs; selecting an optimal MQT from among the one or more candidate MQTs; and when (a) a definition query of the MQT uses a corresponding group-by column list to reference a first number of columns from a set of tables and (b) the incoming query references a second number of columns from the same set of tables, determining one or more of the following: (1) whether one or more of the first number of columns is identical to one or more of the second number of columns; (2) whether one or more of the first number of columns is not contained within the second number of columns; (3) whether one or more of the second number of columns is not contained within the first number of columns; and (4) whether the first number of columns functionally determines the second number of columns.

---

Claim 7:
7. The method of claim 1 , further comprising: when one or more of the group-by columns of the definition query of the MQT are expanded using functional dependency relationships, creating the first set of columns that includes the group-by columns of the MQT definition query expanded; when one or more of the group-by columns of the incoming query are identified, defining the second set of columns by utilizing the one or more of the group-by columns of the incoming query; when one or more matching columns between the first set and the second set are identified, creating a matched group using the one or more matching columns; when one or more of the group-by columns of the first set that do not belong to the matched group are identified, creating a first unmatched group that comprises the one or more of the group-by columns of the first set that do not belong to the matched group; and when one or more of the group-by columns of the second set that do not belong to the matched group are identified, creating a second unmatched group that comprises the one or more of the group-by columns of the second set that do not belong to the matched group.