10. A system comprising: one or more user systems; one or more server systems communicatively coupled with the one or more user systems, the server system to provide a multitenant environment, wherein the multitenant environment includes data for multiple client entities, each identified by a tenant identifier (ID) having one or more users associated with the tenant ID, users of each of multiple client identities can only access data identified by a tenant ID associated with the respective client entity, and the multitenant environment is at least a hosted database provided by an entity separate from the client entities, and provides on-demand database service to the client entities, the one or more server systems to receive a request, via a graphical user interface and with a hardware computing device to provide database search functionality, wherein a database object having a target object type has been selected via the graphical user interface and the request comprises at least a database query, wherein the database query comprises at least an expression using a polymorphic relationship corresponding to the target object type to process, with the hardware computing device, the request utilizing the polymorphic relationship by at least, automatically and without user interaction, selecting relevant set of one or more fields corresponding to the polymorphic reference based on a runtime type of the polymorphic reference, to provide, with the hardware computing device, a user-readable result on the graphical user interface for the query where the result is defined by at least the polymorphic relationship, wherein the polymorphic relationship is specified by the expression that within a clause that allows the request to specify fields of a related parent object that are to be selected based on the type of the parent object.
10. A system comprising: one or more user systems; one or more server systems communicatively coupled with the one or more user systems, the server system to provide a multitenant environment, wherein the multitenant environment includes data for multiple client entities, each identified by a tenant identifier (ID) having one or more users associated with the tenant ID, users of each of multiple client identities can only access data identified by a tenant ID associated with the respective client entity, and the multitenant environment is at least a hosted database provided by an entity separate from the client entities, and provides on-demand database service to the client entities, the one or more server systems to receive a request, via a graphical user interface and with a hardware computing device to provide database search functionality, wherein a database object having a target object type has been selected via the graphical user interface and the request comprises at least a database query, wherein the database query comprises at least an expression using a polymorphic relationship corresponding to the target object type to process, with the hardware computing device, the request utilizing the polymorphic relationship by at least, automatically and without user interaction, selecting relevant set of one or more fields corresponding to the polymorphic reference based on a runtime type of the polymorphic reference, to provide, with the hardware computing device, a user-readable result on the graphical user interface for the query where the result is defined by at least the polymorphic relationship, wherein the polymorphic relationship is specified by the expression that within a clause that allows the request to specify fields of a related parent object that are to be selected based on the type of the parent object. 13. The system of claim 10 wherein the query is processed as a plurality of batches.