1. A computer-implemented method comprising: a database server registering one or more functions included in a user-defined index that includes one or more auxiliary properties; wherein the one or more auxiliary properties are different than, and in addition to, a primary property of the user-defined index that provides for evaluating a user-defined operator; receiving a query that specifies one or more parameters; generating a plurality of execution plans for evaluating the query; estimating a plurality of total costs respectively associated with the plurality of execution plans, wherein estimating a particular total cost associated with a particular execution plan comprises: the database server invoking the one or more functions with one or more function arguments based on the one or more parameters; the database server receiving one or more index costs from the one or more functions, wherein the one or more index costs are associated with using the one or more auxiliary properties of the user-defined index to evaluate the query; and determining the particular total cost based on the one or more index costs; and selecting and storing an optimal execution plan from the plurality of execution plans, wherein the optimal execution plan is associated with an optimal total cost of the plurality of total costs.