Patent ID: 8688689

Claim:
A method comprising: receiving, by a computer system, an SQL statement; identifying, by the computer system, a plurality of plan sources, wherein each plan source stores information pertaining to one or more execution plans, and wherein the information pertaining to the one or more execution plans includes execution statistics for each execution plan; determining, by the computer system, a priority for each plan source in the plurality of plan sources; retrieving, by the computer system, from the plurality of plan sources, information pertaining to the one or more execution plans for the SQL statement, the one or more execution plans having been previously used to execute the SQL statement; wherein the retrieving comprises, on determining an execution plan in the one or more execution plans exists in multiple plan sources, retrieving the information pertaining to the execution plan from a plan source in the multiple plan sources associated with a highest priority; comparing, by the computer system, execution statistics of the one or more execution plans based on the information pertaining to the one or more execution plans; and providing, by the computer system based on the comparing, a recommendation to a user-indicating a particular execution plan in the one or more execution plans to be used to execute the SQL statement.