This is the companion page to my “Learning to Think in Sets.”
- Slides (PDF: 479KB)
- Demo scripts (ZIP: 21KB)
- A SQL Server native backup used by the demo scripts, compatible with SQL Server 2012+ (ZIP: 19MB)
Here are the results from the session. The test number corresponds to the script number.
Test # | Test | Runtime (ms) |
---|---|---|
11 | Cursor | 13,727 |
12 | Cursor read_only fast_forward | 9,616 |
13 | While loop | 8895 |
14 | Set-based | 145 |
20 | Subquery (SELECT clause) | 3849 |
21 | Rewrite using APPLY | 2927 |
22 | Rewrite using #temp | 885 |
23 | Rewrite using RowNum | 521 |
30 | Scalar UDF with data access | 183,561 |
31 | Scalar UDF without data access | 109 |
32 | Multi-statement TVF | 194,591 |
33 | CLR | 184,538 |
34 | APPLY | 2270 |
35 | Inline TVF | 1755 |
36 | RowNum | 239 |
40 | Running total - cursor | 4625 |
41 | Running total - triangle join | 100,000,000 |
42 | Running total - windowing functions | 510 |
60 | C# singleton insert | 10041 |
61 | C# SqlBulkCopy | 87 |
Presentation History:
- SQL Saturday 628 (Baton Rouge, Louisiana), 29 July 2017 (Results)
- SQL Saturday 662 (Sioux Falls, South Dakota), 19 August 2017 (Results)
- SQL Saturday 631 (Wausau, Wisconsin), 16 September 2017 (Results)
- SQL Saturday 680 (Kansas City, Missouri), 7 October 2017 (Results)
- SQL Saturday 774 (Denver, Colorado), 15 September 2018
- DevSpace, Huntsville, Alabama, October 14, 2017 (Results)
- CodeStock, Knoxville, Tennessee, April 20, 2018
- Iowa Code Camp, Ankeny, Iowa, June 17, 2023