1. An apparatus comprising: at least one processor; a memory coupled to the at least one processor; a database table residing in the memory; a query residing in the memory that references the database table; an access plan cache residing in the memory, the access plan cache including: a main access plan that corresponds to the query; and at least one subplan that corresponds to the main access plan, each subplan corresponding to a different version of the query; and a query optimizer residing in the memory and executed by the at least one processor, wherein the query optimizer analyzes the query and determines whether a corresponding main access plan and subplan exists for the query, and if so, the query optimizer uses the corresponding subplan to execute the query.