One embodiment of the present invention provides a system that facilitates
using query signatures to provide security for a database system. During
operation, the database system receives a query. Next, the system parses
the query to determine a signature for the query. This signature
specifies a structure based on operators for the query and is independent
of the value of literals in the query. The system then determines if the
signature can be found in a signature cache which contains valid query
signatures. If so, the system processes the query.