[reporter="jvs", created="Mon, 27 Aug 2007 17:42:46 -0500 (GMT-05:00)"]
Currently it is rather arbitrary. For example:
If a query references a view which contains a dynamic function reference, but the query does not actually reference the dynamic function's output in any way, should the query be marked as unable to be cached? Ideally not, but right now the decision is arbitrary depending on a planner's ordering between firing projection-pushing and expression-reduction rules.
Likewise, if a query references a view which contains a join to a table, but that join gets eliminated by the optimizer, should the query lock the table? Should the query plan be marked as stale if that table changes?
[reporter="jvs", created="Mon, 27 Aug 2007 17:42:46 -0500 (GMT-05:00)"] Currently it is rather arbitrary. For example: