G-7250: Always use NOCOPY when appropriate
Minor
Efficiency
Reason
When we pass OUT or IN OUT parameters in PL/SQL the Oracle Database supports two methods of passing data: By Value and By Reference.
The default, By Value, will copy all the data passed into a temporary buffer. This buffer is passed to the procedure and used during the life of the procedure. Then when processing is complete, the data in the buffer is copied to the original variable.
Passing By Reference is achieved by the NOCOPY hint, and, in contrast, it will pass a reference to the variable's data. Think of a pointer in the C language. This means that no temporary buffer is required. When passing significant amounts of data, the effects of passing values by reference can be significant.
Example (bad)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Example (good)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|