|
最初由 Yong Huang 发布
[B]Follow-up to rwq_ and liuyi8903's two messages. It sounds like a good idea to not use bind variables if the bind values change significantly. The benefit comes from not only plan stability as you described, but possibly also bind length graduation. When the bind value length changes across a bind threshold, a different cursor version is created. For instance, first you bind 'short string' and later you bind 'a string longer than 32 chars...'. A new row is shown in v$sql for the same sql address and v$sqlarea.version_count increments, and v$sql_shared_cursor.bind_mismatch shows 'Y'. I.e., the first cursor is not shared. But the plan is probably still the same.
On the other hand, this benefit is much smaller. Would you not use bind variables simply because run-time bind values change length wildly? I have to think about an answer.
If what I write is not clear, let me know and I'll clarify.
Yong Huang [/B]
也许你所说的情况是可能存在的,我们在很多情况下只能解决大部分的问题,而不能解决所有的问题。 |
|