Patent ID: 8903805

Claim:
A computer implemented method for optimizing a query, comprising: receiving a query that accesses a set of a data having a first subset accessible by index and an established second subset accessible by sequential scan and not accessible by index wherein the query is permitted to access the set of data by sequential scan and not by index; using a processor to perform a transformation to re-write the query based on the first subset of data being accessible by index and the second subset of data being accessible by sequential scan and not accessible by index which results in a transformed query, wherein the transformed query includes a first query portion corresponding to the first subset that is permitted to access the first subset of data by index and a second query portion corresponding to the second subset that is permitted to access the second subset by sequential scan; and optimizing the transformed query such that the first query portion corresponds to a first execution plan and the second query portion corresponds to a second execution plan, wherein the first execution plan is different from the second execution plan.