1. A method of optimizing the execution of queries in a system, comprising: monitoring queries executed in a primary processing environment; selecting a query to be optimized, from the monitored queries; generating a plurality of access plans for the selected query; and determining an optimal access plan by executing the query in a background processing environment using the generated access plans.