1. Technical Field
This invention generally relates to computer systems, and more specifically relates to apparatus and methods for accessing data in a computer database.
2. Background Art
Since the dawn of the computer age, computers have evolved and become more and more powerful. In our present day, computers have become indispensable in many fields of human endeavor including engineering design, machine and process control, information storage and retrieval, and office computing. One of the primary uses of computers is for information storage and retrieval.
Database systems have been developed that allow a computer to store a large amount of information in a way that allows a user to search for and retrieve specific information in the database. For example, an insurance company may have a database that includes all of its policy holders and their current account information, including payment history, premium amount, policy number, policy type, exclusions to coverage, etc. A database system allows the insurance company to retrieve the account information for a single policy holder among the thousands and perhaps millions of policy holders in its database.
Retrieval of information from a database is typically done using queries. A query usually specifies conditions that apply to one or more columns of the database, and may specify relatively complex logical operations on multiple columns. The database is searched for records that satisfy the query, and those records are returned as the query result.
The prior art has recognized that repeatedly optimizing the same query results in a degradation of database performance. As a result, the prior art includes query optimizers that save a query once it is optimized so it may be reused if the exact same query needs to be executed again. In the prior art, however, if the query is different at all, even slightly different, the query must be optimized again from scratch. For example, if a complex query is evaluated, and an operand in the query is a 16 bit integer, the same query that specifies an operand that is a 32 bit integer in the place of the operand that is a 16 bit integer is deemed to be a new query in the prior art, causing the query optimizer to completely optimize the new query, thereby not benefitting from any of the work previously performed in optimizing the query that specifies the 16 bit integer operand. Without a way for a query optimizer to benefit from optimizing that was previously performed on queries that specify operands of different data types, the computer industry will continue to suffer from excessive overhead in optimizing database queries.