Didactically one of the best summary in the short time. I already know the trick with the calculated column, but just the overview of how to read the plan and correctly estimate the individual operator costs is worth its weight in gold. Thank you very much!
Great video...as usual learn lots from your demo(s). Something worth noting for future videos? Even though I tried following along, using SQL Server 2019, no matter what I did, the estimated and actual number of rows were always the same (yes I switched compatibility levels)...any ideas what the problem was? Okay if you didn't glance at the answer already, startup server parameters (i.e. -T2453 and/or -T4199...forget which one (possibly both))!! Took me a while to figure that one out!!
Very good video, thanks. I've taken a step up in my skills and knowledge with all you have taught me. Made a slow query run in 160 ms instead of originals 38 seconds today. The satisfaction 💪😁.
Great to watch and 100% made sense! I wonder, though, if you could have just created the statistics instead of creating a computed column. In-lining the UDF was great too. If that wasn't going to be an option, the original results without the UDF could have been dumped to a #tempTable (parallel plan) then queried out with the UDF call. Great watching someone else work though!
Ben - the cool part about all of my training is that I only use open-source stuff, so you're welcome to download the database and give it a shot to answer your questions. Go for it!
Regarding the statistic comment, I thought this also. When it came to it and I tested it, I realised you can't create statistics in the format col1+col2+col3, only on col,col2,col3 (or in the this case, the single computed column)
Great video, thanks for sharing, just one note - column names are not the same for the original and updated query At ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7hv4vD7Cfy0.html they are “PostType, Posts” At ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7hv4vD7Cfy0.html they are “PostTypeName, Posts” It is a small misprint, but if they use some app to call this procedure, it may break it. And depending on the size, bureaucracy and politics in this organisation it can end up with “This guy broke our app, let’s revert his changes and do reindex more often.” 😊
Would it make a difference replacing "WHERE (u.DownVotes + u.UpVotes + u.Reputation + u.Views) > 1000000" with "WHERE MagicInterestingTotal > 1000000" ?
Download the Stack Overflow database and give 'er a shot. That's why I use these open source tools for training, so you can answer your own questions quickly.
@@svorskemattias yep, just only so much I can teach per video. I talk about the details of things like that in other videos. One of the toughest things about teaching is wanting to teach everything in every single video - but that's why I teach training classes.