1. A method of optimizing database queries in a multi-tenant database system having a relational data store and a non-relational data store, the method comprising: receiving a request at a host system for the multi-tenant database system, the request specifying data to be retrieved from the multi-tenant database system; retrieving, based on the request via the host system, one or more locations of the data to be retrieved; generating, at the host system, a database query based on the request, wherein the database query specifies a plurality of data elements to be retrieved, the plurality of data elements including one or more data elements residing within the non-relational data store and one or more other data elements residing within the relational data store; optimizing the database query via a query optimizer to generate an optimized database query having an optimized query syntax that is distinct from a query syntax of the database query; and executing the optimized database query against the multi-tenant database system to retrieve the data.