7. The method of claim 1 , wherein obtaining updated statistics from a further store comprises: determining whether sufficiently updated statistics for compiling the first query are available from a second store or a third store comprising statistics associated with the table in the database; if sufficiently updated statistics for compiling the first query are not available from the second store or the third store, collecting the updated statistics from the database, storing the updated statistics in the second store, and retrieving the updated statistics for compiling the first query from the second store.
1. A method for updating database statistics for use in generating query execution plans, comprising: receiving a first query for a table in a database; determining whether valid and updated statistics for compiling the first query are available from a first store comprising a first entry with statistics associated with the table in the database; if valid and updated statistics for compiling the first query are not available from the first store, obtaining updated statistics from a further store comprising statistics associated with the table in the database; and storing the obtained updated statistics associated with the table in the database in the first store as a second entry, thereby storing multiple entries for the statistics associated with the same table in the database, wherein the first store is a metadata cache and the further store is a temporary cache.