1. Technical Field
This invention generally relates to a database management system performed by computers, and more specifically relates to the optimization of structured query language (SQL) grouping queries using an encoded vector index (EVI).
2. Background Art
An index in a book facilitates locating information on a specific topic quickly and without blindly paging through the book. Database indexes provide similar benefits by providing a method to quickly locate data of interest. Without an index, a database performs a full table scan, blindly searching through every row in a database table until the target data is located. Thus, depending upon where data resides in a database table, such a scan can be a lengthy and inefficient process.
Indexed scans of database tables are more efficient than full table scans since the length of database index entries are in most cases shorter than the database table entries. Shorter entries mean that more index entries can be stored in a single computer page. Indexed scans can therefore result in a considerable reduction in the total number of computer pages that must be processed in order to locate the requested data.
While indexed scans of database tables can improve performance, the complexity of the data being scanned and of the nature of the database query still determine how effectively a query can be implemented. Different queries place differing levels of processing demands on the database in unique ways. As a result, different index types are needed to cope with a users' ever-changing workloads. One type of index is the encoded vector index (EVI), disclosed U.S. Pat. No. 5,706,495, Chadha et al., Jan. 6, 1998, Encoded-Vector Indices For Decision Support and Warehousing (hereinafter “Chadha”), which is incorporated by reference.
An encoded vector index (EVI) is a variation of the bitmap index concept. A bitmap index indicates whether a specific value exists for each row in a particular column. One bit represents each row. Thus, in the bitmap index for the value “MN” in the column “LOCATION,” the nth bit equals 1 if the nth row of the data table contains “LOCATION”=“MN,” or 0 if that row holds a value other than “MN.” An EVI serves a similar purpose, but only one index is necessary to account for all the values occurring in the column (whether they be “NY,” “MN,” or any other). So in an EVI on the “LOCATION” column, the nth position of the EVI contains a bit code that identifies the value of “LOCATION” in the nth row of the table. Thus, whereas a distinct bitmap index is required to map each distinct key value in a database field, only one EVI is required to represent the same information. Thus, an EVI saves computer memory by including all possible key values for a given field in one database index.
Chadha discloses a method to efficiently scan relational database information by performing bit-vector operations on EVI's, instead of performing analogous operations on the relational database table itself. Yet, the use of and dependence on relational database tables has increased dramatically during the past decade, and continues to increase. Thus, new uses of database tools, such as EVI's, are needed in order to continue to provide significant improvements in query performance; otherwise, database users will be hampered in their ability to maximize intelligent information retrieval.