15. A program product, comprising: program code configured upon execution thereof to: apply transitive closure analysis to at least one search condition in a query that includes criteria that references a plurality of tables in order to re-order a result set generated for the query, and based on the transitive closure analysis, rewrite the criteria to generate modified criteria to reduce the number of tables referenced thereby, wherein the criteria is one of a GROUP BY clause and an ORDER BY clause, wherein the program code is configured to apply transitive closure analysis to identify from the at least one search condition an equivalent field for a field referenced in the criteria, wherein the program code is configured to rewrite the criteria by substituting the equivalent field for the field referenced in the criteria, and wherein the modified criteria references only one table; and a recordable computer readable medium storing the program code.
15. A program product, comprising: program code configured upon execution thereof to: apply transitive closure analysis to at least one search condition in a query that includes criteria that references a plurality of tables in order to re-order a result set generated for the query, and based on the transitive closure analysis, rewrite the criteria to generate modified criteria to reduce the number of tables referenced thereby, wherein the criteria is one of a GROUP BY clause and an ORDER BY clause, wherein the program code is configured to apply transitive closure analysis to identify from the at least one search condition an equivalent field for a field referenced in the criteria, wherein the program code is configured to rewrite the criteria by substituting the equivalent field for the field referenced in the criteria, and wherein the modified criteria references only one table; and a recordable computer readable medium storing the program code. 16. The program product of claim 15 , wherein the program code is further configured to: run the query according to a join order that is based on the modified criteria.