You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Stored_Procedure/dbo.sp_BenchmarkTSQL.sql
+42-41Lines changed: 42 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -25,22 +25,22 @@ ALTER PROCEDURE dbo.sp_BenchmarkTSQL(
25
25
Run SQL statement specified times, show results, insert execution details into log table master.dbo.BenchmarkTSQL.
26
26
27
27
.PARAMETER @tsqlStatementBefore
28
-
TSQL statement that executed before tested main TSQL statement.
28
+
TSQL statement that executed before tested main TSQL statement - not taken into account when measuring @tsqlStatement. Default is NULL.
29
29
30
30
.PARAMETER @tsqlStatement
31
-
TSQL statement for benchmarking.
31
+
TSQL statement for benchmarking. Mandatory parameter.
32
32
33
33
.PARAMETER @tsqlStatementAfter
34
-
TSQL statement that executed after tested TSQL statement.
34
+
TSQL statement that executed after tested TSQL statement - not taken into account when measuring @tsqlStatement. Default is NULL.
35
35
36
36
.PARAMETER @numberOfExecution
37
37
Number of execution TSQL statement.
38
38
39
39
.PARAMETER @saveResults
40
-
Save benchmark details to master.dbo.BenchmarkTSQL table if @saveResults = 1. Create table if not exists (see 245 line: CREATE TABLE master.dbo.BenchmarkTSQL …).
40
+
Save benchmark details to master.dbo.BenchmarkTSQL table if @saveResults = 1. Create table if not exists (see 243 line: CREATE TABLE master.dbo.BenchmarkTSQL …).
41
41
42
42
.PARAMETER @skipTSQLCheck
43
-
Checking for valid TSQL statement. Default value is 0 (false) - skip checking.
43
+
Checking for valid TSQL statement. Default value is 1 (true) - skip checking.
44
44
45
45
.PARAMETER @clearCache
46
46
Clear cached plan for TSQL statement. Default value is 0 (false) - not clear.
@@ -52,7 +52,7 @@ ALTER PROCEDURE dbo.sp_BenchmarkTSQL(
52
52
PRINT detailed step information: step count, start time, end time, duration.
53
53
54
54
.PARAMETER @durationAccuracy
55
-
Duration accuracy calculation, possible values: ns, mcs, ms, ss, mi, hh, dd, wk. Default value is ss - seconds.
55
+
Duration accuracy calculation, possible values for this stored procedure: ns, mcs, ms, ss, mi, hh, dd, wk. Default value is ss - seconds.
56
56
See DATEDIFF https://docs.microsoft.com/en-us/sql/t-sql/functions/datediff-transact-sql
57
57
58
58
.PARAMETER @dateTimeFunction
@@ -126,9 +126,9 @@ The above copyright notice and this permission notice shall be included in all c
126
126
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. INNOEVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF ORIN CONNECTION WITH THE SOFTWARE OR THE USEOR OTHER DEALINGS IN THE SOFTWARE.
127
127
128
128
.NOTE
129
-
Created date: 2017-12-14by Konstantin Taranov
130
-
Version: 5.0
131
-
LastModified: 2019-03-17by Konstantin Taranov
129
+
Version: 5.1
130
+
Created: 2017-12-14by Konstantin Taranov
131
+
Modified: 2019-03-28by Konstantin Taranov
132
132
Main contributors: Konstantin Taranov, Aleksei Nagorskii
'. Try to use @durationAccuracy with a less precise datepart - seconds (ss) or minutes (mm) or days (dd).'+ @crlf +
550
-
'But in log table master.dbo.BenchmarkTSQL all times saving with DATETIME2(7) precise! You can manualy calculate difference after decreasing precise datepart.');
550
+
'But in log table master.dbo.BenchmarkTSQL all times saving with DATETIME2(7) precise! You can manualy calculate difference after decreasing precise datepart.'+ @crlf +
551
+
'For analyze log rable see latest example in document section.');
0 commit comments