User Guide > Performance Tuning > Working with the SQL Execution Plan > Updating the Query Execution Plan
 
Updating the Query Execution Plan
An execution plan is generated the first time a SQL statement is executed, and whenever the query changes. The query execution plan is cached, so if the underlying data or statistics change, it is a good idea to regenerate the execution plan as described below.
A simple way to force a refresh of an execution plan is to add a space to the query. You can also flush the query plan cache for all views by temporarily toggling the Query Plan Cache Enabled key in the TDV Configuration window as described in Refreshing All Execution Plan Caches.
To update the query execution plan
1. If statistics have changed on the view, gather statistics as described in Creating Cardinality Statistics for a View.
2. Regenerate the execution plan using one of these methods:
Click Show Execution Plan on the view editor toolbar. (For an OLAP View editor, the button is on the toolbar of the SQL tab.
Or
In the Execution Plan panel, click Generate Plan.
3. Optionally, type a value in the Refresh Rate field, to specify a regular interval at which to update the execution plan.