InterviewSolution
| 1. |
What Are Bind Variables And Why Are They Important? |
|
Answer» With bind variables in SQL, Oracle can cache related queries a single time in the SQL cache (area). This avoids a hard parse each time, which saves on various locking and LATCHING resources we use to check OBJECTS existence and so on. BONUS: For rarely run queries, especially BATCH queries, we explicitely DO NOT WANT to use bind variables, as they hide information from the Cost Based Opitmizer. With bind variables in SQL, Oracle can cache related queries a single time in the SQL cache (area). This avoids a hard parse each time, which saves on various locking and latching resources we use to check objects existence and so on. BONUS: For rarely run queries, especially BATCH queries, we explicitely DO NOT want to use bind variables, as they hide information from the Cost Based Opitmizer. |
|