28 November 2006

How The Oracle Database Processes SQL Statements

Eddie Awad posted (in June) a nice flowchart of what Oracle does when it processes a SQL statement. Of particular import is the note in step 2 (parsing):

"If a similar SQL statement exists in the shared pool, Oracle skips the parsing step. A SQL statement is parsed once no matter how many times the statement is run. As you can see, parsing does many things and consumes time and resources. You should always aim at minimizing parsing when writing SQL."

How do you minimize parsing? Bind variables! Now go re-write all of your applications to use them.

No comments:

Post a Comment