According to the present invention, an apparatus and method to
significantly improve performance of the SQL DISTINCT function processing
through the use of an encoded vector index (EVI) is disclosed. An EVI
provides the data necessary to generate query results for SQL DISTINCT
functions that specify one or more database fields upon which the EVI is
built. Sequentially scanning through the EVI symbol table, each unique
value or combination of values in the one or more database fields
specified in the DISTINCT function are returned to provide the requested
query results. By processing the EVI symbol table in lieu of more
traditional database indexes, and/or in lieu of the database table itself,
query results for SQL DISTINCT functions are generated significantly
faster.