Patent Document ID: 9262457
Application ID: 13965552

Base Claim:
1. A method for creating a hash index on-demand and reusing the hash index for queries in a database, comprising: determining, by at least one processor, during query optimization that a first database query has a query execution plan comprising a sub-query which executes N times a correlated predicate having an operator being one of equal and not equal to a base column; comparing, by the at least one processor, based on the correlated predicate, a cost of creating a hash index and probing the hash index N times to a cost of fully scanning the base column N times; creating on-demand, by the at least one processor, a hash index based on the comparing; and executing, by the at least one processor, a second database query using the hash index, wherein the executing eliminates fully scanning the base column N times.

---

Claim 7:
7. The method of claim 1 , further comprising: determining that the cost of creating the hash index and probing the hash index N times is less than fully scanning the base column N times; and populating the hash index, the hash index comprising a hash table associating values in a column with rows in a database table version, wherein the hash table comprises: at least one element being a pair of a pointer to a value in the column and a row specification.