Methods and apparatus are provided for rewriting queries during a database
query processing operation to include auxiliary attributes not included
in the original query, thus improving processing efficiency. For example,
in one aspect of the invention, a technique for rewriting a query in a
query processing operation includes the following steps. First, the query
is processed in accordance with at least a portion of a data set,
producing query results. Second, data attributes from the query results
are analyzed. Finally, at least one new predicate from at least one
auxiliary data attribute is appended on the query.