Database Reference
In-Depth Information
logical_reads,
row_count,
original_login_name
FROM sys.dm_exec_sessions
WHERE session_id = 176 // replace with your session_id
This statement returns important performance metrics for your previous SQL statement, as
explained in Table 12-3.
Table 12-3. Selected columns from sys.dm_exec_sessions
Metric
Value
Comment
login_time
2010-04-22
16:43:30.557
The login time of the session. Note that sessions can be reused
over time, through connection pooling. This time represents
the last successful login.
host_name
DEVDSK01
The machine name that made the connection to the SQL
Azure database.
program_name
SSMS
The application name that is executing the statement on the
client workstation.
host_process_id
7720
The Windows Process ID (PID) that is executing the statement
on the client workstation. You can view the PID of your
applications in Task Manager in Windows.
cpu_time
15
The CPU time, in milliseconds, consumed by the SQL
statements since the connection was established.
memory_usage
2
Number of 8KB bytes consumed by the connection so far.
total_elapsed_time
32
The duration of the statement in milliseconds. This includes
the time to execute the statement and the time it takes to
return the data to the client machine.
reads
1
Number of physical reads.
writes
1
Number of physical writes.
logical_reads
322
Number of logical reads.
row_count
50
Number of rows returned.
original_login_name MyTestLogin The login name of the user who successfully connected.
At this point, you need to be aware of a point that is very important for performance tuning. The
cpu_time is perhaps the best metric you can use to determine how long a statement takes to execute in
SQL Azure. The total_elapsed_time can be misleading. Elapsed time represents the time it takes for SQL
Azure (or SQL Server) to fetch the data and return all the data to the client. So, if your client is slow at
Search WWH ::




Custom Search