1. A method for optimizing a query in a database system, the method comprising: receiving a query request with a query predicate to filter data returned in response to the query request, wherein the query predicate comprises a formula; transforming the query request to a transformed query request by preprocessing the formula in the query predicate; and optimizing the query request using the transformed query request.