Author: way0utwest

  • Mastering Index Tuning–Day 1

    This is a short series of posts on the courses I took with Brent Ozar. I actually completed the courses in the past, but I wrote notes and wanted to revisit the way things went. I started with the Mastering Index Tuning class.

    I took the class a few weeks ago, but I scheduled this out for when I returned from vacation.

    A Late Start

    The classes started at 9am Eastern time. That’s 7am for me, which is a touch early. I’m usually awake, but not always at my desk. In this case, I was hustling a bit to get through a morning routine, including a shower since I had a meeting during the day.

    I managed to get to my desk and start the GoToWebinar and found a welcome slide up that noted the class will start at 5 minutes after. That’s cool since it meant I could go start coffee without missing anything.

    This also gave me a chance to switch to speakers for the audio. I’m at home, and have my own office, so I was glad to not wear a headset all day. We were on mute, but I muted myself with a hard button, just to be sure there weren’t any disturbances from my end.

    Setup

    I’d gotten the email the night before with a lab VM and credentials. After getting coffee going (priorities are important), I came back, logged in and fired up SSMS, leaving things alone.

    I also popped open the webinar and Slack. That’s 3 things going on at once. Fortunately, I have three monitors, so this worked out well. I put the VM in front of me, since it’s always easier to concentrate straight ahead. The left monitor got Brent and the GoToWebinar. That meant a full screen for slides and a small area for the webcam Brent runs. I find it easier to follow along if I can see someone. I then put Slack up on the right screen, set to the channel for the classes.

    I think that taking this on a laptop would be tougher, but doable. This is especially true if you are watching the recorded items. There isn’t a rapid movement of slides, so you could focus on Slack and listen, or watch and come back to the VM when appropriate. I followed along a few times with Brent, so I was glad for the multiple monitors.

    The Day 1 Flow

    The class opens with introductions of Brent and a few people mentioned from Slack. He does orient us to remember to open Slack for questions and discussion. One nice thing here is there isn’t any time spent chatting with each other, or a limited amount in Slack.

    We introduce the VM and how it’s configured, along with some explanation. It might feel unnecessary, but I expect that most people have questions or would have done one thing differently. Across the class, we each might think about one different thing, so it’s good. I like that Brent also warns us what not to touch, since it’s easy to blow things up. We also start up a workload with SQLQueryStress before a break.

    The first thing is a lecture about how to use indexes and some demos. After some basics, we get into how we get information from the DMVs and elsewhere, and Brent uses various sp_BlitzXX scripts. I think that’s good as he’s put time into these scripts to make them helpful. They’re not necessarily better than those you might build yourself, or get from other speakers, but they are useful.

    We have a first mini lab, which we work on and then Brent reviews what he’d do. Then a little more lecture before a lunch lab. In this one, we have to analyze and post our proposed changes in Slack. Brent then acts as a manager to approve changes.

    I like this, and it’s a good way to sanity check yourself without just doing something. The lab is a 2 hour lab, but it’s designed as a lunch break as well. Good for some, but it’s 9:30ish for me. That’s early. Still, I do the lab and then spend time on other work.

    After lunch, we review the lab with Brent, watch what he does. That’s good, and it helps people learn, without picking on their solution. The afternoon passes with more lecture and then a final lab that we can tackle then or do in the morning. Since my time is offset and the class starts at 7, I decide to just do it then. Again, propose changes and get them approved.

    One nice thing is that Brent is watching Slack while presenting, so he can respond to comments or questions inline with what he’s teaching. This also makes for some fun distractions with comments and questions, and things aren’t scripted. Brent will pop something open in a browser to teach.

    A long day, made longer since I still need to do some SQLServerCentral stuff, but it was a good day.

    If you’re interested in the class, you can visit the Mastering Index Tuning page to learn more and purchase the class.

  • String or binary data would be truncated

    Microsoft, please fix this. This issue is still out there, and once again, it’s the top voted on item for SQL Server. Everytime I see this:

    Msg 8152, Level 16, State 13, Line 1
    String or binary data would be truncated.

    I’m annoyed, and I’m not alone. If you’ve had to load data into SQL Server, and you’ve every encountered this error, you’ve probably been frustrated. In fact, when you get this particular error, you might wonder what to do.

    Many of us find this error to be a problem because we don’t know where the error is located. In fact, we often end up jumping through hoops to somehow track down the offending row. We might scan through our input file. Or we might build a parallel process to load the data into a series of MAX columns and then use T-SQL to search out the data, change it, and then export it again for us in our ETL process. Or we might throw up our hands in frustration and go for a walk.

    SQL Server developers, if you feel any of these things, go vote for this item.

    When there is a mismatch between our input data and the schema, there is a lot of friction to getting work done. While DBAs might be willing to track down the invalid rows, developers hate it and business people often get confused. This one reason why developers dislike relational schemas and look for easier data stores, like NoSQL databases. Trying to figure out that there’s one name in a list of 1000 that’s got 31 characters and doesn’t fit in a 30 character field is a pain for anyone..

    I have no idea of the effort to fix this, but this isn’t a syntactical sugar item. Microsoft, this is a piece of work that can be extremely helpful. Pick a method to solve thisand get to work. Ignore the error rows and output them, let us redirect them to another table, or some up with some other solution. Make something simple that works, but please, just fix this.

    It should be embarassing to you that this is still a issue that is reported and voted on in SQL Server.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.8MB) podcast or subscribe to the feed at iTunes and Libsyn.

  • Republish: When Work Gets in the Way of Work

    Coming back from Ireland today and the last day of vacation. A republish if When Work Gets in the Way of Work.

  • Republish: Closer to the Heart

    One of my favorite Rush songs, but also an editorial. I’m in Ireland with my wife, so it’s being re-run.