Linear instance mapping for query rewrite
AssigneeOracle International Corporation
InventorMurali Thiyagarajan
Life of this patent
Estimating the term…
Abstract
Described herein are instance mapping techniques that facilitate the rewrite of queries to access materialized views that have multiple instances of the same table. Instance mapping techniques are processes for determining a mapping between equivalent instances in a query and materialized view definition. An instance in a query that is equivalent to an instance in a materialized view definition (or another query) is treated as if they are identical labels for the same table for the purposes of rewriting a query. To determine the mapping between instances of a table in a query and a materialized view definition, join predicates in the query and materialized view definition that involve instances of the table are compared.
Claims20
A method for use in evaluating queries, the method including the computer-implemented steps of:
- receiving a query that includes a first plurality of labels for a first table, wherein each label of said first plurality of labels is different than any other label of said first plurality of labels, wherein said query includes first one or more join predicates that each reference at least one of said first plurality of labels;
- wherein a materialized view definition includes a second plurality of labels for said first table, wherein said materialized view definition includes second one or more join predicates that each reference at least one of said second plurality of labels;
- causing a comparison of said first one or more join predicates to said second one or more join predicates to determine which of said first one or more join predicates are equivalent to a join predicate of said second one or more join predicates;
- generating data representing a mapping of a first label of said first plurality of labels to a second label of said second plurality of labels based on said comparison;
- wherein said first label is different than said second label;
- and
- wherein at least one of said first label and said second label is an alias for said first table.
A computer-readable medium carrying one or more sequences of instructions for use in evaluating queries, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
- receiving a query that includes a first plurality of labels for a first table, wherein each label of said first plurality of labels is different than any other label of said first plurality of labels, wherein said query includes first one or more join predicates that each reference at least one of said first plurality of labels;
- wherein a materialized view definition includes a second plurality of labels for said first table, wherein said materialized view definition includes second one or more join predicates that each reference at least one of said second plurality of labels;
- causing a comparison of said first one or more join predicates to said second one or more join predicates to determine which of said first one or more join predicates are equivalent to a join predicate of said second one or more join predicates;
- generating data representing a mapping of a first label of said first plurality of labels to a second label of said second plurality of labels based on said comparison;
- wherein said first label is different than said second label;
- and
- wherein at least one of said first label and said second label is an alias for said first table.
Dependencies are inferred from the claim text.