Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Profiler CPU / duration units

The output from a SQL Server trace in profiler contains the columns CPU and Duration (amongst others). What units are these values in?

like image 559
PaulB Avatar asked Jun 10 '09 16:06

PaulB


People also ask

What is CPU in SQL Profiler?

CPU is in milliseconds. In sql server 2005 and later, duration is in microseconds when saved to a file or a table, and milliseconds in the user interface. In sqlserver 2000, it is always in milliseconds.

Does running SQL Profiler affect performance?

Yes it affects performance. The best indicator would be to monitor your performance on the server before running the profiler and the performance once it's running. Running it on another server will still affect performance.

What is the CPU unit of SQL profiler?

SQL Profiler CPU / duration units. Beginning with SQL Server 2005, the server reports the duration of an event in microseconds (one millionth, or 10 -6 of a second) and the amount of CPU time used by the event in milliseconds (one thousandth, or 10 -3 of a second). In SQL Server 2000, the server reported both duration and CPU time in milliseconds.

What is the default unit for duration column in SQL Server Profiler?

According to the documentation (for SQL Server Profiler 2016) the default unit for the Duration column is milliseconds. Show values in Duration column in microseconds Displays the values in microseconds in the Duration data column of traces. By default, the Duration column displays values in milliseconds.

Does SQL Server report CPU time in milliseconds or microseconds?

In SQL Server 2000, the server reported both duration and CPU time in milliseconds. In SQL Server 2005 and later, the SQL Server Profiler graphical user interface displays the Duration column in milliseconds by default, but when a trace is saved to either a file or a database table, the Duration column value is written in microseconds.

What is SQL Server Profiler date and time display format?

You can configure the SQL Server Profiler date and time display format to assist in trace analysis. Using SQL Server Profiler, you can troubleshoot data by grouping traces or trace files by the Duration, CPU, Reads, or Writes data columns.


1 Answers

CPU is in milliseconds. In sql server 2005 and later, duration is in microseconds when saved to a file or a table, and milliseconds in the user interface. In sqlserver 2000, it is always in milliseconds. From MSDN.

User jerryhung gives a more accurate version-specific information in a comment:

Beginning with SQL Server 2005, the server reports the duration of an event in microseconds (one millionth, or 10-6 of a second) and the amount of CPU time used by the event in milliseconds (one thousandth, or 10-3 of a second). In SQL Server 2000, the server reported both duration and CPU time in milliseconds. In SQL Server 2005 and later, the SQL Server Profiler graphical user interface displays the Duration column in milliseconds by default, but when a trace is saved to either a file or a database table, the Duration column value is written in microseconds.

like image 133
RolandTumble Avatar answered Sep 24 '22 02:09

RolandTumble