Why does ORACLE calls VPD function twice on every DML? [message #268142] |
Mon, 17 September 2007 14:27 |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
Hi, I have a table called NEWS that contains an VPD policy enabled for INSERT,DELETE,SELECT and UPDATE statements.
I started saving logs in a table whenever it calls the VPD function and it surprised me that for each INSERT,DELETE,SELECT or UPDATE it uses the VPD function twice. Do you know why is that happening?.
Thanks in advance.
|
|
|
|
|
Re: Why does ORACLE calls VPD function twice on every DML? [message #268275 is a reply to message #268153] |
Tue, 18 September 2007 01:55 |
|
Michel Cadot
Messages: 68722 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote: | it's a dbms_rls.dynamic policy
|
Quote: | DYNAMIC: The default policy type. Server assumes the predicate may be affected by any system or session environment at any time, and so always reexecutes the policy function on each statement parsing or execution. Applies to only one object.
|
So function is called each time Oracle encounters it in its access path (code plan execution).
No I can't give you the link, I should have to do what you can: search in AskTom. Try something like "how many times a function is called" or a variant.
Regards
Michel
[Updated on: Tue, 18 September 2007 01:55] Report message to a moderator
|
|
|
Re: Why does ORACLE calls VPD function twice on every DML? [message #268420 is a reply to message #268275] |
Tue, 18 September 2007 09:17 |
Agus211
Messages: 39 Registered: September 2007
|
Member |
|
|
Hi, thanks Michel for answering. My context(and the predicate) changes when an user sets it's client identifier, is there any way to cache the predicate of the user until the client identifier of the session changes?. I've read that SHARED_CONTEXT_SENSITIVE doesn't work with client identifier changing, so it wouldn't cache the new predicate for the user.
|
|
|
|