1. A computer-implemented method of improving a query, the method comprising: receiving at a network interface of a server an original query transmitted by a user, wherein the original query is associated with data within a database, and wherein the database includes at least a first index and a second index; retrieving, using a processor of the server, metadata associated with the data, wherein at least a portion of the data is stored in a common table within the database system; determining, using the processor, a tenant-selective query syntax, wherein determining comprises analyzing at least one of metadata generated from information about a tenant of an on demand services environment or metadata generated from the data accessible by the tenant; and generating, using the processor, an improved query using the query syntax, wherein the improved query is based at least in part upon the original query and a result of a join between a first number of rows associated with the first index and a second number of rows associated with the second index.