6. A method for managing a database comprising: generating a cache key for a given received query; generate the cache key based on another received query, the another received query having a different parameter than the given received query; and access a query repository table to change at least one of heuristic and logic functions of a query optimizer for generating query plans, the changing of the at least one of the heuristic and logic functions of the query optimizer being based on runtime statistics stored in the query repository table; retrieving a query record from the query repository table, wherein the query record is associated with the cache key generated for the given received query and the another received query, wherein the retrieved query record comprises an annotated query plan that includes text defining a shape of query tree for a relational database, wherein the retrieved query record is stored in the query repository table before the generating of the cache key based on the another received query; and generating two different query plans based on the annotated query plan of the retrieved query record.
6. A method for managing a database comprising: generating a cache key for a given received query; generate the cache key based on another received query, the another received query having a different parameter than the given received query; and access a query repository table to change at least one of heuristic and logic functions of a query optimizer for generating query plans, the changing of the at least one of the heuristic and logic functions of the query optimizer being based on runtime statistics stored in the query repository table; retrieving a query record from the query repository table, wherein the query record is associated with the cache key generated for the given received query and the another received query, wherein the retrieved query record comprises an annotated query plan that includes text defining a shape of query tree for a relational database, wherein the retrieved query record is stored in the query repository table before the generating of the cache key based on the another received query; and generating two different query plans based on the annotated query plan of the retrieved query record. 7. The method of claim 6 , wherein the retrieved query record comprises a status indicator with a value indicative of FORCE.