Avoiding Bad Query Performance

T-SQL
There’s a very old saying, “When you find yourself in a hole, stop digging.” And my evidence today is: That’s certainly not the hairiest execution plan I’ve seen. In some ways, it’s not all that horrible. But it sure is evidence that someone was down in a hole and they were working that shovel hard. If you’re interested, most of the operators are scans against a table variable that’s 11 million rows deep. There are also table spools chugging away in there. And the select statement only returns 1500 rows. Please, stop digging.
Read More

Meme Monday: Deadlines

Professional Development
Tom LaRock (blog|twitter) has assigned an interesting topic for Meme Monday this month, working with deadlines. Some people hate deadlines. Some people love deadlines. But when you have one, there’s a good chance you need to really meet that deadline or there could be repercussions. I have a tip that I’ve found useful in the past. When I have a deadline for delivery of X, I evaluate that requirement and determine what, if anything, is dependent upon other people. I’ve found this to be the biggest issue because my deadline is seldom their deadline. So if there are parts of my deadline where I’m dependent on others, that’s my first task: Go have a chat. Here are a few questions: Is X a deadline for them? If so, when do…
Read More

Learning, Networking & Wine

Misc
Let’s say, you want to spend a couple of days learning about SQL Server. You also want to spend some time networking with others. And, it just so happens, you’re a bit of a wine connoisseur. I have the event with you in mind. It’s the first ever, SQL Excursion. It’s due to take place May 17-19 in Napa Valley. The training is from two of the biggest names in the industry, Denny Cherry and Tom Larock. I learn from these guys all the time and now it’s your turn. But this isn’t going to be 60 minutes in a presentation followed by 10 minutes in the hallway at a SQL Saturday. Not, this is going to be intense sessions with these guys on topics from performance tuning to troubleshooting…
Read More

Tech on Tap v1.1 Wrap-up

SQL Server
The first ever Tech on Tap event was held on Saturday, January 27th, 2012 at the Stone Cellar Brewpub in Appleton, WI. If you weren’t there, well, you missed it. Notice that keyword in that earlier sentence, Brewpub. Yes, the Tech on Tap events (and there will be more) are specifically designed to mix Technology and Beer in a learning and networking event with a single focus. This first event was all about virtualization. The space where the event was held was the back bar of the Brewpub in a private room. The layout of the tables wasn’t perfect for presenting, but they were very conducive to networking. Other than that, the space was just excellent. The first presenter was Brian Lewis (blog) from Microsoft. He spoke about virtualization in…
Read More

Execution Plans, What Do I Look At?

SQL Server, T-SQL
The question came up, what are the top 3-5 things that you look at in a query. I realized then that I hadn’t really written them down. There are some areas that let me know pretty much immediately where problems lie within a plan. You don’t necessarily know the answer from looking at these things, but you know you have a problem. Being me, I couldn’t stick to 5, so here are 6: Immediately check the properties on the first operator (SELECT/DELETE/INSERT). There’s tons of information in here and people frequently just ignore it. You can see if the plan is based on full optimization or not. That immediately tells me if I’m working on the optimizer’s best estimate at a plan or I’m looking at a timeout. If it’s…
Read More

Deadlock Monitoring

T-SQL
There are four different ways you can get information about deadlocks in your system. These are: traceflag 1204 traceflag 1222 trace events extended events For years I’ve been pushing traceflag 1222 as the best of the lot. Well, that’s over. I’ve been learning more and more about extended events and I’m currently in love with xml_deadlock_report event. Why? Simple, it has everything that traceflag 1222 has, but there are two glorious things about it. First, it’s not going to be filling up my error log with, for the error log, noise. Seriously. As much as I liked the information displayed from traceflag 1222, I didn’t like what it did to the log, but I saw it as a necessary evil. Second, it’s XML baby! That means you can set up…
Read More

Stop PIPA & SOPA

Misc
I’m not going to black out my blog, because, let’s face it, who’s going to notice? But for all six of you who read this (and, of course, you Mom), I do want to point out that these are horrific bad bills. They are sponsored by Democrats and Republicans, so party affiliation shouldn’t enter into this. In this case, they’re all bad guys. And why? Greed, pure & simple. Hollywood donates millions & millions to politicians and they expect these people to stay bought and deliver on their “anit-piracy” legislation. Don’t know anything about this? Here’s an article. Just don’t focus on SOPA. It’s the bill sponsored by the Republicans (which for some reason is the only one called out as evil…grrr). There’s also PIPA, which is the Senate equivalent…
Read More

Friday SQL Nugget #1

Professional Development
Gee thanks Jes (blog|twitter). Just what I wanted, a little extra work on a Friday afternoon. I used to like you. We have a tagging theme started by Ted Krueger (blog|twitter) who I also used to like. The theme is: Deciding that I need to delete and start all over Lordy I hate this one. See, I find it easy to decide that I need to delete and start all over. My challenging task is persevering. But… here’s the rub. Because my challenge is persevering, I have a tendency to try to persevere when I really should be throwing in the towel. I don’t have a technical example of this ready at hand (I did mention it was the afternoon on a Friday, right?), but I do have a presentation…
Read More

Database Backups: Things You Need To Do Now

SQL Server, T-SQL
I want to say a few things about database backups that you need to know. Wait a minute, haven’t you written about backups before? Why, yes. Yes I have. Aaand… you’re doing it again because? Have you noticed the shocking number of questions that come up on SQL Server Central and #sqlhelp regarding backups? Have you noticed the incredibly huge number of people who don’t have backups at all? That’s why. To get the word out. Oh, good point. Carry on. Because backups are so easy, people tend to discount them. That is, until they need them. Then, suddenly, they become extremely important. Here’s a suggestion: Make databases important now. Learn how SQL Server backup works. Make sure you have backups on your systems. Make sure you have the appropriate…
Read More

PASS Summit 2012 Evaluation Results

PASS, Professional Development
I say it all the time because it’s worth repeating, feedback is a gift. Good, bad or indifferent (well, not indifferent), feedback is a wonderful gift. Any time you appreciate a speaker, give them feedback. Any time you think a speaker could improve, give them feedback. Any time you hate a speaker, give them feedback. It’s really the best thing you can do. With that in mind, I have a huge stack of gifts in front of me here, the evaluations from the PASS Summit.Thank you very much to each and every one of the 160 different evaluations I received. I presented three times at the summit, once on a pre-con with Gail Shaw called “All About Execution Plans,” one time in a spotlight session called “DMOs as a Shortcut…
Read More