1. A method comprising, by one or more computing devices: determining rankings for a plurality of objects of a social-networking system, wherein: the social-networking system comprises a social graph that comprises a plurality of nodes and a plurality of edges connecting the nodes, each object corresponds to a node of the social graph, and each ranking for each object is determined based on a number of edges being connected to the node to which the respective object corresponds; storing the objects in a plurality of partitions of a database, wherein each partition stores only objects having a particular ranking; and indexing the objects in the partitions by a plurality of search indices that each index only a particular one of the plurality of partitions.