Optimize the SQL statement

Once the query parser has separated the SQL statement into its syntactic parts, the query optimizer can create a query plan that efficiently organizes the execution of the SQL statement. The query optimizer formulates a query plan to fetch the data rows that are required to process a query.

For more information, see Optimize a user-defined routine.