Reporting and summarizing metrics in sparse relationships on an OLTP database
Storing and/or accessing data in a transactional database, with use of the following technique: (i) selecting a set of base tables in a transactional database; and (ii) creating a factless materialized query table, having maximum sparsity, for the set of base tables. The set of base tables includes at least two base tables. The set of base tables includes a set of keys including at least two distinct primary keys. The factless materialized query table includes one record associated with each record in the set of base tables. Each record in the materialized query table includes a value for every primary key in the set of base tables.
1. A method comprising:
selecting a set of base tables in a transactional database; and
creating a factless materialized query table, having maximum sparsity, for the set of base tables;
wherein:
the set of base tables includes at least two base tables;
the set of base tables includes a set of keys including at least two distinct primary keys;
the factless materialized query table includes one record associated with each record in the set of base tables; and
each record in the materialized query table includes a value for every primary key in the set of base tables.
2. The method of claim 1 wherein the transactional database is part of an online transaction processing system.
3. The method of claim 1 wherein:
in the creation of the materialized query table, a null flag is assigned for every primary key value in every record in the materialized query table where the corresponding record(s) in the set of base tables does not include that primary key.
4. The method of claim 3 wherein:
in the creation of the materialized query table, each record of the materialized query table is created to include a determinant that uniquely identifies a level of granularity for that materialized query table record.
5. The method of claim 4 further comprising:
receiving a user query; and
responding to the user query based, at least in part, upon at least one determinant in the materialized query table.
6. The method of claim 1 wherein:
the selection of the base tables of the set of base tables causes the MQT created upon the set of selected base tables to join multiple dimensions.