Patent ID: 7089225

Claim:
A computer-based method using heuristics in selecting a materialized view (MV) from multiple materialized views matching a query, said method comprising the steps of: (a) receiving a query, Q; (b) ordering materialized view candidates in a list based upon a descending order of reduction powers, wherein reduction power of a material view, M, is a function of cardinalities of common tables between query, Q, and materialized view definition, V, and cardinality of M; (c) matching a query with materialized views in said ordered list by identifying a materialized view candidate based on any of, or a combination of, the following heuristics: avoiding choosing an MV which is locked by REFRESH process, choosing a matching that does not require regrouping, choosing a matching that does not require a rejoin, choosing a matching that does not have a residual join, choosing an MV with the largest reduction power; and (d) outputting said materialized view candidate identified in (c).