Search notes:

Oracle: SQL parsing

When executing an SQL statement, the first step is to parse the SQL statement's text.
This is a non-trivial and costly (in terms of CPU cycles) task:

Hard and soft parse

Because parsing a statement is costly, Oracle checks if Oracle already has parsed the SQL text (and stored the result in the library cahce) wheneven an SQL statement is requested to be executed.
If this is the case and the result of that previous parsing can be used for execution, then Oracle can use that result for the execution of the «new» SQL statement. This situation is referred to as soft parse and the reusable data structures are found in the shared SQL area of the library cache.
If Oracle does not find a suitable representation in the shared SQL area, the statement needs to be parsed (possibly again). This is referred to as hard parse or library cache miss.
Part of the hard parse is to determine if the available optimizer statistics are sufficient to generate an optimal execution plan. If this is not the case, Oracle determines dynamic statistics as part of the hard parse.

See also

library cache

Index