Patent attributes
Various embodiments are disclosed for optimizing the execution of a query to retrieve data associated with multiple entities from a database server system, where the entities are associated with a user of a social networking system. At least one embodiment includes analyzing parameters of the query to identify one or more databases at which to execute the query, determining whether to execute constraint type parameters on the data retrieved at a frontend or backend server of the server system, and separating the performance of privacy checks on the data retrieved from the execution of the query. The embodiment further includes executing, based on the databases identified, the query in parallel threads to retrieve individual data sets of a result set, where a particular individual data set is associated with a particular entity.