Query optimizers normally compile queries into one optimal plan by assuming complete knowledge of all cost parameters such asselectivity and resourceavailability. The execution of such plans could be sub-optimal when cost parameters are either unknown at compile time or change significantly between compile time and runtime [Loh89, GrW89]. Parametric query optimization [INS+92, CG94, GK94] optimizes a query into a number of candidate plans, eachoptimal for someregion of the parameter space. In this paper, we present parametric query optimization algorithms. Our approach is based on the property that for linear cost functions, eachparametric optimal plan is optimal in a convex polyhedral region of the parameter space. This property is used to optimize linear and non-linear cost functions. We also analyze the expected sizes of the parametric optimal set of plans and the number of plans produced by the Cole and Graefe algorithm [CG94].