Patent ID: 7254574

Claim:
A method implemented on a computer for querying data residing in a base table, comprising: receiving a query; receiving an indexed view for a functional invocation over the data, the functional invocation comprising a table valued function, and the data comprising XML valued data fields; determining if the query can be 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 can be satisfied by the index view; introducing a back-join to the indexed view and 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 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 wherein performing the unnesting operation provides an unnested result, and further comprising indexing a view on the unnested result.