Once SQL Optimizer generates execution plan alternatives, you can execute them to test each alternative or use Batch Run to test all alternatives simultaneously. Executing the alternatives retrieves run time statistics and identifies the best alternative for your database environment.
Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.
To execute a single statement
Select a single SQL statement in the Plans pane.
Click and select Execute (All Records) or Execute (First Record).
To execute selected statements
In the Plans pane, select multiple SQL statements in one of the following ways:
- To select a consecutive group of SQL statements, click the first SQL, press and hold SHIFT, and then click the last SQL.
- To select non-consecutive SQL statements, press and hold CTRL, and then click each SQL that you want to select.
Click and select All Records or First Record, Batch Run Selected.
To execute all statements
Click and select All Records or First Record, Batch Run Selected.
Every Plan Control session can have its own batch run settings. See the following topics for more information:
Tips:
You can use the Batch Run Multiple Function to obtain statistics for statements with run times in the millisecond range. Statements with run times in the millisecond range can be skewed by other active processes because run time is based on a CPU's clock time. Multiple active processes can slow down CPU performance and result in a longer than normal run time for a statement. Use this function to execute selected or all statements multiple times. The statistics reported using this function are an average of the results from these multiple executions.
To execute selected statements multiple times
Select multiple alternatives in the Plans pane.
Click and select All Records) or First Record, Batch Run Multiple Selected.
Enter the number of times you want each SQL statement executed.
To execute all statements multiple times
Click and select All Records or First Record, Batch Run Multiple All.
Enter the number of times you want each SQL statement executed.