1. A computer-implemented method for optimizing a database query in a computer system, comprising: generating a query execution plan for the database query; storing the query execution plan in an in-line query capture database; executing the query execution plan in order to retrieve data from a database stored on the computer system; monitoring the execution of the query execution plan in order to generate performance information; and storing the performance information in the in-line query capture database.