1. A method comprising: receiving, from a client device of a first user of an online social network, a structured query comprising references to one or more selected objects associated with the online social network; parsing the structured query to identify a first query constraint and one or more second query constraints; identifying an inverse constraint associated with the first query constraint, wherein the first query constraint has been previously flagged as identifying greater than a threshold number of objects; and generating a query command based on the structured query, wherein the query command comprises the inverse constraint and the one or more second query constraints.