Plan guides let you improve query performance without changing the original query or application code. You can use plan guides to apply query hints or associate a fixed execution plan with a query at run time.
In Database Explorer, you can manage plan guides by using the shortcut menu. Right-click a plan guide to access options such as generating a script or viewing its properties.

You can create a plan guide in the SQL Editor by using one of these features:
1. In Database Explorer, right-click a required plan guide and select Generate Script As, then select the statement type.
2. Select an output option:
In Database Explorer, right-click the plan guide or Plan Guides node and select Show Details.
Object Viewer opens and provides detailed information about the plan guide.
In Database Explorer, right-click the plan guide or Plan Guides node and select Refresh, or press F5.
In Database Explorer, right-click the plan guide and select Properties, or press F4.
1. In Database Explorer, right-click the Plan Guides node and select Filter.
2. In the Filter Settings dialog, configure the filter parameters.
3. Click OK to apply the filter.
Note
When you expand the Plan Guides node, the number of objects it contains appears in parentheses next to the node name. This number changes depending on the applied filter settings.
1. In Database Explorer, right-click the plan guide you want to delete and select Delete, or press Delete.
2. Click Yes to confirm the deletion.
Note
You cannot undo the drop operation, as this action permanently deletes the plan guide. To avoid data loss, back up the database before deleting the plan guide.
The following table describes the shortcut menu commands available for a plan guide in Database Explorer.
| Name | Description |
|---|---|
| Generate Script As | Generates a script for the selected object using the CREATE, DROP, and DROP and CREATE statements. The script can be generated to a new SQL document or to a file, or copied to the clipboard. |
| Show Details | Opens Object Viewer that displays object details. |
| Delete | Drops the selected object from the database. Shortcut: Delete |
| Refresh | Updates the object to reflect the latest changes. Shortcut: F5 |
| Properties | Opens the Properties pane to view the object information. Shortcut: F4 |
The following table describes the shortcut menu commands available for the Plan Guides node in Database Explorer.
| Name | Description |
|---|---|
| Filter | Opens the Filter Settings dialog to control which plan guides should appear in Database Explorer. |
| Show Details | Opens Object Viewer that displays object details. |
| Refresh | Updates the object to reflect the latest changes. Shortcut: F5 |
In Database Explorer, hold down Ctrl and select multiple plan guides. Then right-click the selection and select the required option.
The following table describes the shortcut menu options available for multiple plan guides.
| Name | Description |
|---|---|
| Generate Script As | Generates a script for the selected objects using the CREATE, DROP, and DROP and CREATE statements. The script can be generated to a new SQL document or to a file, or copied to the clipboard. |
| Delete | Drops the selected plan guides from the database. Shortcut: Delete |
