1. A method for matching an input query having a search pattern that includes a combination of attribute names, logical operators and attribute values to a library of queries used for accessing information in a database directory, comprising: partitioning each of the queries in the library into logical units, wherein each logical unit comprises a combination of an attribute name, logical operator and attribute value; for each of the queries in the library, comparing the search pattern of the input query to each partitioned logical unit, wherein the comparing comprises comparing the attribute name of the input query to the attribute name in the logical unit, the operator used in the input query to the operator used in the logical unit and the attribute value in the input query to the attribute value in the logical unit; and determining whether there is a match between the input query and any of the logical units associated with each of the queries in the library.