1. A method for database query optimization in a computer system, comprising the steps of: maintaining historical execution data with respect to each of a plurality of user-defined functions; receiving a database query having a plurality of logical conditions, said database query including at least one of said user-defined functions in at least one of said logical conditions; using said historical execution data to predict an optimal ordering of evaluation of said plurality of logical conditions; and evaluating said database query in accordance with said predicted optimal ordering of evaluation of said plurality of logical conditions.