9. A system comprising: one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising: identifying, by one or more processors, one or more web page impressions satisfying one or more simple queries, each of the one or more web page impressions associated with a respective impression ID, each web page impression being an instance of a previous presentation of a web page, where each web page has one or more attributes and associated values that describe entities that are targeted by the web page and where identifying one or more web page impressions includes comparing terms of a respective simple query to the one or more attributes and associated values of a given web page; storing the respective impression IDs of the one or more web pages satisfying the one or more simple queries; subsequent to storing the respective impression IDs, receiving a query from a client device; determining a number of criteria included within the query; comparing the number of criteria to a predetermined number; and identifying, by one or more processors, a number of impression IDs for the one or more web pages satisfying the query based on the identified one or more web page impressions satisfying the one or more simple queries, wherein identifying the number of impression IDs for the one or more web pages satisfying the query based on the identified one or more web page impressions satisfying the one or more simple queries occurs if the number of criteria is less than or equal to the predetermined number.
11. The system of claim 9 , further comprising operations of dividing the query into one or more sub-queries if the number of criteria exceeds the predetermined number.