Database Reference
In-Depth Information
■
Note
You need to establish two connections using the same login name, or you can't retrieve the performance
metrics of the SQL statement you're trying to tune.
For example, establish a connection to SQL Azure, and run the following SQL query:
SELECT TOP 50 * FROM sys.indexes
Note your session id; it's found on the status bar in Microsoft SQL Server Management Studio. You
can also find it on the query tab, in parentheses. For example, in Figure 12-1, the session id is 144: you
can see it both on the selected tab and in the status bar at the bottom.
Figure 12-1.
Capturing a statement's performance metrics
Next, open another query window, which opens a new connection in SQL Azure. Run the following
query (see Figure 12-1), and make sure to specify the session id being investigated:
SELECT
login_time,
host_name,
program_name,
host_process_id,
cpu_time,
memory_usage,
total_elapsed_time,
reads,
writes,