A method to addresses structural performance problems of a database query
language statement is provided. The method includes receiving a database
query language statement at an optimizer, evaluating choices in a search
space to generate an execution plan for the statement, and producing
annotations to record one or more reasons for selecting each choice while
generating the execution plan.