Execution Plans in Azure SQL Database

Azure
Microsoft has stated pretty clearly that they're putting code on Azure first, ahead of the desktop. Which makes one wonder when we're going to start to see some of this cool stuff within SSMS. What cool stuff you ask? Well, let me explain. Let's start with a query: SELECT m.MovieName, msd.MovieStageName, st.StageTypeDesc FROM dbo.Movie AS m JOIN dbo.MovieStage AS ms ON m.MovieId = ms.MovieID JOIN dbo.MovieStageDefinition AS msd ON ms.MovieStageDefinitionId = msd.MovieStageDefinitionId JOIN dbo.StageType AS st ON msd.StageTypeId = st.StageTypeId WHERE m.MovieId = 42; When I run this on Windows Azure SQL Database (WASD) I get the following execution plan: Kind of weird, kind of useful, right? First thing new that I can do is zoom in using that slider bar you seen in the lower left and then graphical…
Read More

Laws You Break at Your Peril

Professional Development
Laws of Thermodynamics TANSTAAFL Gods of the Copybook Headings All magic comes with a price Winter Is Coming My adult years started with a pretty thorough education in physics thanks to Uncle Sugar and the Navy Nuclear Power School. The laws of thermodynamics were carved into our brains (along with Baumgart's Law*). Experience has taught me that all these other statements are more or less riffs on the concepts put forward by the fundamentals of the laws of thermodynamics. They're just applications of the same within social spheres. In short, if you have a physical engineering background, you tend to be a realist. But note, I'm not a pessimist. I just recognize a simple thing. No matter how positive my thoughts are, no matter my belief in the righteousness of…
Read More

Star Trek and the Death of IT

Misc
GAAAAAAAHHHHH!!!! I feel slightly better, but only slightly. I started watching Star Trek: The Next Generation on Netflix just to unwind my brain and relax a little. Instead of relaxation I found myself pacing back and forth in front of the television, gesticulating wildly, with a string expletives coming out of my mouth in a torrential flood (yeah, my kids loved it). What happened in the 24th century? Did the entire race of IT Pros die out in the 23rd? Because there sure as heck is no evidence that they are ANYWHERE to be found. Episode after episode there are computer problems. And episode after episode my blood pressure is rising. I can't believe what I'm seeing. For example, in one episode they get an alien computer virus (firewall, checksums,…
Read More

Time to Chat

Professional Development, Redgate Software
The greatest part of my job is that I get to travel all over the world to present different technical sessions. But, it's not the presentations that make it cool. It's the fact that I get to meet people. I get a chance to hang out with my #sqlfamily. I get a chance to make new friendships. Those contacts are amazing. I love the opportunity to sit down and talk to people about what they're doing with technology, the challenges they face, what's common with my own experience, what's different. From all that, I get a chance to grow and learn. Sometimes I even get the chance to help people. I'm going to be all over the place between now and June. I'd love to get the opportunity to talk…
Read More

Pro SQL Server 2012 Practices: Chapter 17

HDInsight
I jumped at the opportunity to write a chapter for this book, Pro SQL Server 2012 Practices, because of all the fantastic people writing and the topics that were covered. I reviewed Chapter 12 a few weeks ago and I've been meaning to get this chapter, Big Data for the SQL Server DBA, read & reviewed but I've just been sidetracked. I finally noticed it on my Trello board, weeks out of date, and decided to finally get the job done. Carlos Bossy (b|t) is a great guy and a part of my SQL Family. We run into each other all the time at SQL Saturday's and other events. I've never listened to him present before, and now, after reading his chapter in the book, I'm very sorry. I'll fix…
Read More

It Is Your Fault

Professional Development
I earned my nickname. I'm proud of it. I am the Scary DBA. I don't really like to advertise my other nickname, Rant (get it, Grant shortened to another word). I earned that one too. I'm not proud of it at all. I got that one because I sometimes don't listen as much as I should and, because I tend to be more than a little passionate about my job and my databases, I would go off on a rant. And yeah, I stood in the way of some development processes and approaches that I shouldn't have. Instead of facilitating the development team and trying to understand their problems and issues, I just said "No." Usually at length. I just finished reading this post from Martin Fowler, whose work I've  enjoyed,…
Read More

SQL Saturday #187 Richmond And More

Professional Development, Redgate Software
In just a couple of weeks I'll be flying down to Richmond, VA to speak at SQL Saturday #187. I'll be presenting two topics, Backups for the Accidental DBA and Query Tuning in the Clouds. It's going to be a great event with a bunch of excellent speakers. If you're in the area, come on down and say hello. And, if you have some time on Friday before the event, Red Gate Software is hosting a special 1/2 day seminar targeting the database professional just getting started with their career. There are only a few seats left, so if you're interested, sign up quick. Steve Jones and I will be presenting on several topics from monitoring to backups, database corruption and indexing. It'll be great way to learn, network, see…
Read More

SQL Server Naming Standards

T-SQL
Want to start a fight between a bunch of DBAs or database developers? Ask them where the comma should be placed between columns in a SELECT statement. It's actually a little disturbing just how much emotional value people place in this. Almost as good, tell a database developer you don't like their naming standard. Hoo boy! The purpose of a naming standard, I think most of us can agree, is for clarity. We're defining language so that we all mean the same thing when we say it, right? We want to communicate clearly, so we're going to implement a naming standard. Fine. Sounds good. And then, you get this: dbo.tblDdltbl Umm... Wait. What? And there are hundreds of these, all with the same first three letters, tbl. Oh, wait, I…
Read More

DBAs and the Dark Closet

Professional Development
For many years, I loved being a DBA because, unlike being a developer, I could sort of hide from the world. I could go into a dark closet (a well-lit cube, but hang with me here) and hide from everyone (except the people in the cubes next to me, my boss, the teams I supported, the people I passed on the way to the toilet, others) and just be a hermit (except for the daily stand-ups, weekly status meetings, occasional training) and only ever talk to people when things went wrong at 3AM (or at 2PM when the CIO and a bunch of other managers would be standing in my desk). As long as I did my job well, maintaining the backups, running maintenance, and setting appropriate security settings, I…
Read More

New DMO in Azure SQL Database: sys.dm_db_wait_stats

Azure
I just did a series of Boogle searches and when that didn't find anything I tried Ging. Neither listed sys.dm_db_wait_stats. Nothing in a search directly against MSDN either. So, let me introduce you to a new DMO, sys.dm_db_wait_stats. It's a dynamic management view since it doesn't require any input. The output is about what you would expect if you thought about it for a second:   In short, what we have is the sys.dm_os_wait_stats moved internally into your SQL Database so, even though you cannot get at any of the OS counters from with an a SQL Database normally. In short, thanks Microsoft. Now we can see the wait statistics on our Azure SQL Database in order to better understand where things are problematic. Without documentation I don't know for…
Read More