Answer by Joe Obbish for How can I get running totals of recent rows faster?
I recommend testing with a bit more data to get a better idea of what's going on and to see how different approaches perform. I loaded 16 million rows into a table with the same structure. You can find...
View ArticleAnswer by Josh Darnell for How can I get running totals of recent rows faster?
Difference in the first two approachesThe first plan spends about 7 of the 10 seconds in the Window Spool operator, so this is the main reason it's so slow. It's performing a lot of I/O in tempdb to...
View ArticleAnswer by Luis Cazares for How can I get running totals of recent rows faster?
When dealing with such a small subset of rows returned, the triangular join is a good option. However, when using window functions you have more options that can increase their performance. The default...
View ArticleHow can I get running totals of recent rows faster?
I'm currently designing a transaction table. I realized that calculating running totals for each row will be needed and this might be slow in performance. So I created a table with 1 million rows for...
View Article