1. A method of generating an optimal access path to data for a query being performed by a computer system to retrieve data from a database stored in a data storage device coupled to the computer system, the method comprising: generating a plurality of access paths for the query; determining an uncertainty for the query, wherein the uncertainty is the difference between selectivity assumptions about the costs for each of the access paths; determining a sensitivity of the query to the uncertainty, wherein the sensitivity is the difference between the costs of the access paths for the selectivity assumptions; and selecting one of the access paths according to the uncertainty and the sensitivity.