Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions Example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Example Statistics IO Output

## Input statement

SQL Server parse and compile time:<br />
CPU time = 108 ms, elapsed time = 108 ms.

(13431682 row(s) affected)<br />
Table 'PostTypes'. Scan count 1, logical reads 2, physical reads 1, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
Table 'Users'. Scan count 5, logical reads 42015, physical reads 1, read-ahead reads 41306, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
Table 'Comments'. Scan count 5, logical reads 1089402, physical reads 248, read-ahead reads 1108174, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
Table 'PostTags'. Scan count 5, logical reads 77500, physical reads 348, read-ahead reads 82219, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
Table 'Posts'. Scan count 5, logical reads 397944, physical reads 9338, read-ahead reads 402977, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
Table 'Worktable'. Scan count 999172, logical reads 16247024, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

SQL Server Execution Times:<br />
CPU time = 156527 ms, elapsed time = 284906 ms.<br />
SQL Server parse and compile time:<br />
CPU time = 16 ms, elapsed time = 19 ms.<br />

(233033 row(s) affected)<br />
Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
Table 'Votes'. Scan count 1, logical reads 250128, physical reads 10, read-ahead reads 250104, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.<br />
Table 'Posts'. Scan count 1, logical reads 165586, physical reads 18, read-ahead reads 49191, lob logical reads 823463, lob physical reads 42854, lob read-ahead reads 3272.<br />
Table 'Users'. Scan count 1, logical reads 41405, physical reads 3, read-ahead reads 41401, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

SQL Server Execution Times:<br />
CPU time = 17207 ms, elapsed time = 38163 ms.<br />
Msg 207, Level 16, State 1, Line 1<br />
Invalid column name 'scores'.<br />
SQL Server parse and compile time:<br />
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:<br />
CPU time = 0 ms, elapsed time = 0 ms.

## Output Statement

|| CPU | Elapsed |
|------------------------------------|--------------|--------------|
| SQL Server parse and compile time: | 00:00:00.108 | 00:00:00.108 |

**13,431,682 rows affected**

| Row Num | Table | Scan Count | Logical Reads | Physical Reads | Read-Ahead Reads | LOB Logical Reads | LOB Physical Reads | LOB Read-Ahead Reads | % Logical Reads of Total Reads |
|---------|-----------|-----------:|--------------:|---------------:|-----------------:|------------------:|-------------------:|----------------------|-------------------------------:|
| | Total | 999,193 | 17,853,887 | 9,936 | 1,634,676 | 0 | 0 | 0 | |
| | PostTypes | 1 | 2 | 1 | 0 | 0 | 0 | 0 | 0.000 |
| | Users | 5 | 42,015 | 1 | 41,306 | 0 | 0 | 0 | 0.235 |
| | Comments | 5 | 1,089,402 | 248 | 1,108,174 | 0 | 0 | 0 | 6.102 |
| | PostTags | 5 | 77,500 | 348 | 82,219 | 0 | 0 | 0 | 0.434 |
| | Posts | 5 | 397,944 | 9,338 | 402,977 | 0 | 0 | 0 | 2.229 |
| | Worktable | 999,172 | 16,247,024 | 0 | 0 | 0 | 0 | 0 | 91.000 |
| | Worktable | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000 |

|| CPU | Elapsed |
|-----------------------------|--------------|--------------|
| SQL Server Execution Times: | 00:02:36.527 | 00:04:44.906 |

|| CPU | Elapsed |
|------------------------------------|--------------|--------------|
| SQL Server parse and compile time: | 00:00:00.016 | 00:00:00.019 |

**233,033 rows affected**

| Row Num | Table | Scan Count | Logical Reads | Physical Reads | Read-Ahead Reads | LOB Logical Reads | LOB Physical Reads | LOB Read-Ahead Reads | % Logical Reads of Total Reads |
|---------|----------:|-----------:|--------------:|---------------:|-----------------:|------------------:|-------------------:|---------------------:|-------------------------------:|
| | Total | 3 | 457,119 | 31 | 340,696 | 823,463 | 42,854 | 3,272 | |
| | Worktable | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000 |
| | Votes | 1 | 250,128 | 10 | 250,104 | 0 | 0 | 0 | 54.718 |
| | Posts | 1 | 165,586 | 18 | 49,191 | 823,463 | 42,854 | 3,272 | 36.224 |
| | Users | 1 | 41,405 | 3 | 41,401 | 0 | 0 | 0 | 9.058 |

|| CPU | Elapsed |
|-----------------------------|--------------|--------------|
| SQL Server Execution Times: | 00:00:17.207 | 00:00:38.163 |

**Msg 207, Level 16, State 1, Line 1<br />
Invalid column name 'scores'.**

|| CPU | Elapsed |
|------------------------------------|--------------|--------------|
| SQL Server parse and compile time: | 00:00:00.000 | 00:00:00.000 |

|| CPU | Elapsed |
|-----------------------------|--------------|--------------|
| SQL Server Execution Times: | 00:00:00.000 | 00:00:00.000 |

#### Totals:

| Table | Scan Count | Logical Reads | Physical Reads | Read-Ahead Reads | LOB Logical Reads | LOB Physical Reads | LOB Read-Ahead Reads | % Logical Reads of Total Reads |
|-----------|-----------:|--------------:|---------------:|-----------------:|------------------:|-------------------:|---------------------:|-------------------------------:|
| Total | 999,196 | 18,311,006 | 9,967 | 1,975,372 | 823,463 | 42,854 | 3,272 | |
| Comments | 5 | 1,089,402 | 248 | 1,108,174 | 0 | 0 | 0 | 5.949 |
| Posts | 6 | 563,530 | 9,356 | 452,168 | 823,463 | 42,854 | 3,272 | 3.078 |
| PostTags | 5 | 77,500 | 348 | 82,219 | 0 | 0 | 0 | 0.423 |
| PostTypes | 1 | 2 | 1 | 0 | 0 | 0 | 0 | 0.000 |
| Users | 6 | 83,420 | 4 | 82,707 | 0 | 0 | 0 | 0.456 |
| Votes | 1 | 250,128 | 10 | 250,104 | 0 | 0 | 0 | 1.366 |
| Worktable | 999,172 | 16,247,024 | 0 | 0 | 0 | 0 | 0 | 88.728 |

|| CPU | Elapsed |
|------------------------------------|--------------|--------------|
| SQL Server parse and compile time: | 00:00:00.124 | 00:00:00.127 |
| SQL Server Execution Times: | 00:02:53.734 | 00:05:23.069 |
| Total | 00:02:53.858 | 00:05:23.196 |
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
Statistics-IO-Parser
====================
# Microsoft SQL Server Statistics IO and Time Parser
Sometimes reading SQL Server output from Statistics IO and Statistics Time can be a total drag. This page will help with that. Just paste in the output of Statistics IO and/or Statistics Time and press Parse. Your output will be formatted and totaled. Enjoy.

Useful links:
- [SET STATISTICS IO (Transact-SQL)](https://msdn.microsoft.com/en-us/library/ms184361.aspx)
- [SET STATISTICS TIME (Transact-SQL)](https://msdn.microsoft.com/en-us/library/ms190287.aspx)

## [Example](/Example.md)
36 changes: 36 additions & 0 deletions src/assets/data/languagetext-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"langvalue" : "it",
"langname" : "Italian" ,
"table" : "Tabella",
"scan" : "Conteggio analisi ",
"logical" : "letture logiche ",
"physical" : "letture fisiche ",
"readahead" : "letture read-ahead ",
"loblogical" : "letture logiche LOB ",
"lobphysical" : "letture fisiche LOB ",
"lobreadahead" : "letture LOB read-ahead ",
"headerrownum" : "Riga",
"headertable" : "Tabella",
"headerscan" : "Conteggio analisi",
"headerlogical" : "Letture logiche",
"headerphysical" : "Letture fisiche",
"headerreadahead" : "Letture read-ahead",
"headerloblogical" : "Letture logiche LOB",
"headerlobphysical" : "Letture fisiche LOB",
"headerlobreadahead" : "Letture LOB read-ahead",
"headerperlogicalread" : "% Letture logiche sul totale",
"executiontime" : "Tempo di esecuzione SQL Server:",
"compiletime" : "Tempo di analisi e compilazione SQL Server:",
"cputime" : "tempo di CPU = ",
"elapsedtime" : "tempo trascorso = ",
"elapsedlabel" : "Tempo trascorso",
"cpulabel" : "CPU",
"milliseconds" : "ms",
"rowsaffected" : "righe interessate" ,
"headerrowsaffected" : " righe interessate",
"headerrowaffected" : " riga interessata",
"errormsg" : "Mes",
"sampleoutput" : "Tempo di analisi e compilazione SQL Server: \r\n tempo di CPU = 0 ms, tempo trascorso = 0 ms.\r\n\r\n(25499 righe interessate)\r\nTabella \u0027Workfile\u0027. Conteggio analisi 0, letture logiche 0, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027Worktable\u0027. Conteggio analisi 0, letture logiche 0, letture fisiche 0, letture server di pagine 0, letture read-ahead 856, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027FATRIG\u0027. Conteggio analisi 1, letture logiche 13563, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027FATTES\u0027. Conteggio analisi 1, letture logiche 3748, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027COMRIG\u0027. Conteggio analisi 1, letture logiche 170, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027CONTI\u0027. Conteggio analisi 1, letture logiche 224, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027TIPIDOC\u0027. Conteggio analisi 2, letture logiche 8, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahea LOB server di pagine 0.\r\nTabella \u0027COMTES\u0027. Conteggio analisi 1, letture logiche 1702, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027CLIENTI\u0027. Conteggio analisi 2, letture logiche 20, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027PERSONE\u0027. Conteggio analisi 4, letture logiche 794, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027ANAPAG\u0027. Conteggio analisi 1, letture logiche 5, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027NAZIONI\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027AGENTI\u0027. Conteggio analisi 2, letture logiche 4, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027LOTSER\u0027. Conteggio analisi 1, letture logiche 18, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027ARTICO\u0027. Conteggio analisi 1, letture logiche 370, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027CLASSI\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027CATOMO\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027GRUPPI\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027LINEEP\u0027. Conteggio analisi 1, letture logiche 2, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\nTabella \u0027MARCHE\u0027. Conteggio analisi 1, letture logiche 4, letture fisiche 0, letture server di pagine 0, letture read-ahead 0, letture read-ahead server di pagine 0, letture logiche LOB 0, letture fisiche LOB 0, letture LOB server di pagine 0, letture LOB read-ahead 0, letture read-ahead LOB server di pagine 0.\r\n\r\nTempo di esecuzione SQL Server: \r\n tempo di CPU = 657 ms, tempo trascorso = 944 ms.\r\n\r\nMessaggio 207, livello 16, stato 1, riga 1\r\nIl nome di colonna \u0027test\u0027 non è valido.\r\n"
}


10 changes: 8 additions & 2 deletions src/assets/js/statsioparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ function determineLang(strRow){

if (strRow.substring(0,7) === 'Table \'') { lang = 1; } // English
else if (strRow.substring(0, 7) === 'Tabla \'') { lang = 2; } // Spanish
else if (strRow.substring(0, 7) === 'Tabella \'') { lang = 3; } // Italian
else if ($.trim(strRow.substring(0, 6)) === 'Tiempo') { lang = 2; } // Spanish
else if ($.trim(strRow.substring(0, 6)) === 'Tempo') { lang = 3; } // Italian
else if ($.trim(strRow.substring(0, 7)) === 'Tiempos') { lang = 2; } // Spanish
else if ($.trim(strRow.substring(0, 7)) === 'Tempo') { lang = 3; } // Italian

return lang;
}
Expand All @@ -94,6 +97,9 @@ function determineLangFilename (langType) {
case 'es': // Spanish
filename = 'assets/data/languagetext-es.json'
break;
case 'it': // Italian
filename = 'assets/data/languagetext-it.json'
break;
default :
filename = 'assets/data/languagetext-en.json'
break;
Expand Down Expand Up @@ -353,7 +359,7 @@ function outputTimeTable(timeValues, langTitle, langDuration, elapsedLabel, cpuL
//result += '<td class="td-column-right">' + numeral(timeValues.elapsed).format('0,0') + '</td>';
result += '<td class="td-column-right">' + formatms(timeValues.cpu) + '</td>';
result += '<td class="td-column-right">' + formatms(timeValues.elapsed) + '</td>';
result += '</tr></tbody></table><div>';
result += '</tr></tbody></table></div>';

return result;
}
Expand Down Expand Up @@ -390,7 +396,7 @@ function outputTimeTableTotals(executionValues, compileValues, langCompileTitle,
//result += '<td class="td-total td-column-right">' + numeral(elapsedTotal).format('0,0') + '</td>';
result += '<td class="td-total td-column-right">' + formatms(cpuTotal) + '</td>';
result += '<td class="td-total td-column-right">' + formatms(elapsedTotal) + '</td>';
result += '</tr></tfoot></table><div>';
result += '</tr></tfoot></table></div>';

return result;
}
Expand Down
Loading