I have a View whose query plan appears to be cached, is there a way to force the View's plan to be recalculated on each access?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:
Here's how it works:
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
It turns out my problem is due to the VIEW containing aggregate functions.
What looks like a cached query plan is really the planner (by design) not pushing a WHERE clause applied outside the VIEW into the VIEW.