You know that SQL Server 2008 or 2008 R2 box you’ve got sitting around on an old dusty server somewhere? You’ve got 3 months to upgrade this to a version of SQL Server that was released in the last decade.
If you’ve ever had to get involved in query performance you’ll have used execution plans. Azure Data Studio gives execution plans too but they’re a little tricky.
Let’s build a quick query and gather our execution plans. This query will work on any database;
In your query editor window the obvious button is the ‘Explain’ button. This works and will give you the estimated query plan.
You’ll recognise the execution plan that you see in ADS as it looks very much like the same version in SSMS.
Here’s what it would have looked like in SSMS
One advantage ADS has over SSMS is that you can also see the Top Operations natively.
This has been possible in Sentry One Plan Explorer for a long time but it’s also now native in ADS. It’s great when you’re looking at a massive plan and want to drill down into the major pain points quickly.
Getting the actual execution plan is a little more complicated. It’s not a nice easy button so you’ll want to get used to shortcuts.
press Ctrl+Shift+P to open the command palette and type ‘run’. You’ll notice the command to ‘Run Current Query with Actual Plan’. That’s the ticket;
You’ll also notice that there’s an even better shortcut. Ctrl+M is going to execute the query and give you the actual plan.
There is currently a gotcha with ADS actual execution plans where it only renders the last code block. There is an open github issue for this so keep an eye on it as there’s new stuff being released every month.
I love SQL Server and the community that surrounds it. It’s so welcoming, open and accessable.
I’ve had a sort of organic progression of Microsoft products in my career. I’ve gone Excel Developer -> Access Developer -> SQL Server Developer -> SQL Server DBA (there’s some other products in there like SSRS but that’s the main path). I’ve never really felt comfortable with any of the communities around these other products but SQL Server is a different kettle of fish completely.
Finding the SQL Server Community slack channel was a great thing. I am the only DBA where I am (with loads of developers) and having people to chat to about DBA stuff is such a pressure release.
Also, check out the call for speakers at most conferences. It’s not unusual to have a ‘first timers’ track for people who want to get into speaking. Doing this isn’t a necessity but it shows how inclusive the community is.
I didn’t choose to stay with SQL Server because of the technology specifically (although I do enjoy focusing on performance tuning) but rather the community around it.
We’re going to use a Python library called Faker which is designed to generate test data. You’ll need to open the command line for the folder where pip is installed. In my standard installation of SQL Server 2019 it’s here (adjust for your own installation);
This is one of the features of Azure Data Studio that is great for accessibility as well as just being cool.
The default theme is your basic light theme. It’s fine but this isn’t the only theme you have to use.
Use Ctrl+k Ctrl+t to open the theme options.
Have a click through and see how they look when you’re editing code. It’s a case of choosing something that suits your style. My preference is the default dark theme but go nuts and choose one you like.
Oh, and if you’re a sadist, check out the Red theme