The LDBM database works by assigning a compact four-byte unique identifier to each entry in the database. It uses this identifier to refer to entries in indexes. The database consists of one main index file, called id2entry, which maps from an entry's unique identifier (EID) to a text representation of the entry itself. Other index files are maintained, for each indexed attribute for example, that map values people are likely to search on to lists of EIDs.
Using this simple scheme, many LDAP queries can be answered efficiently. For example, to answer a search for entries with a surname of ``Antbear'', slapd would first consult the surname attribute index, look up the value ``Antbear'' and retrieve the corresponding list of EIDs. Next, slapd would look up each EID in the id2entry index, retrieve the corresponding entry, convert it from text to LDAP format, and return it to the client.