Structured indexes on results of function applications over data
First Claim
1. A computer-readable storage medium having stored thereon a data structure, wherein the data structure is generated by a method for querying data, comprising:
- a first data field containing an object; and
a second data field containing data associated with the object, the data being derived from a functional invocation over the data, the functional invocation comprising a table valued function, wherein the method for querying data comprises;
receiving an indexed view for the functional invocation,determining if the query is satisfied by the index view by determining if the query matches the index view;
applying the indexed view as an index to the functional invocation over the data if the query is satisfied by the index view;
introducing a back-join to the indexed view;
applying the indexed view as an index to the functional invocation over the data if the query cannot be satisfied by the index view; and
determining and storing a query result using the index to the functional invocation over the data, wherein determining the query result comprises performing an unnesting operation on nested data, further wherein the unnesting operation is a cross apply unnest operation, and further wherein the indexed view is a generalization of a plurality of partial indexes.
1 Assignment
0 Petitions
Accused Products
Abstract
Indexed views or materialized views are used as a secondary index on a base table with multi-valued attributes. This provides for using the index to search in the nested data. Moreover, indexing is provided on the result of an unnest operation. Indexing a view on the result of an unnesting operation provides the ability to index the contents of a nested collection. One such unnesting operation is “cross apply unnest”. This provides additional options for a query execution plan, leading to a more optimized query. A back-join is provided from the indexed view to the base table to allow fields from the base table that are not present in the indexed view to be included in a result of a query on the table which is processed using the indexed view as an access path. This provides a means of including columns in the query result that are not in the indexed view but are in the base table. The back-join is supported from a single-table indexed view to the base table via a unique clustering key which acts as a logical row locator. Thus, the system can back-join to the base table from an indexed view via the unique clustering key. These features allow the use of indexed views to index a table on the contents of multi-set or multi-valued attributes.
-
Citations
10 Claims
-
1. A computer-readable storage medium having stored thereon a data structure, wherein the data structure is generated by a method for querying data, comprising:
-
a first data field containing an object; and a second data field containing data associated with the object, the data being derived from a functional invocation over the data, the functional invocation comprising a table valued function, wherein the method for querying data comprises; receiving an indexed view for the functional invocation, determining if the query is satisfied by the index view by determining if the query matches the index view; applying the indexed view as an index to the functional invocation over the data if the query is satisfied by the index view; introducing a back-join to the indexed view; applying the indexed view as an index to the functional invocation over the data if the query cannot be satisfied by the index view; and determining and storing a query result using the index to the functional invocation over the data, wherein determining the query result comprises performing an unnesting operation on nested data, further wherein the unnesting operation is a cross apply unnest operation, and further wherein the indexed view is a generalization of a plurality of partial indexes. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer-readable storage medium having stored thereon a data structure, wherein the data structure is generated by a method for querying data, comprising:
-
a first data field containing an object; and a second data field containing data associated with the object, the data being derived from a functional invocation over the data, the functional invocation comprising a table valued function, wherein the method for querying data comprises; receiving an indexed view for the functional invocation, determining if the query is satisfied by the index view by determining if the query matches the index view; applying the indexed view as an index to the functional invocation over the data if the query is satisfied by the index view; introducing a back-join to the indexed view; applying the indexed view as an index to the functional invocation over the data if the query cannot be satisfied by the index view; and determining and storing a query result using the index to the functional invocation over the data, wherein determining the query result comprises performing an unnesting operation on nested data, wherein the unnesting operation is a cross apply unnest operation, and wherein performing the unnesting operation provides an unnested result, and further comprises indexing a view on the unnested result. - View Dependent Claims (7, 8, 9, 10)
-
Specification