SQL University–Recommendations for a Clustered Index

SQL Server, T-SQL
Welcome, SQL University Students to another extension class here at Miskatonic University, home to the Fighting Cephalopods (GO PODS!). Never mind the stains on the floor, or the walls…or those really nasty ones on the ceiling. There was a… oh what did the dean call it… an incident last week when one of the students had a little accident after reading Die Vermiss Mysteriis one too many times. But we’re not here to talk about arcane tomes and unspeakable horrors today. No, today we’re here to talk about clustered indexes. SQL Server storage is really predicated around the idea of clustered indexes. Don’t believe me? Let’s list a few places that require a clustered index: Partitioning. A table in SQL Azure In order to create XML indexes What about the…
Read More

SQL Saturday #67 Wrap-up

PASS
Just… Wow. What an event. What a great group of people. I’m just so lucky to be involved with fantastic individuals like these. Thanks for having me out to play everyone, I really appreciated it. SQL Saturday #67 started for me with my second FreeCon (follow the link for details on the first one). Brent Ozar (blog|twitter) put together another great session where we spent a lot of time talking about blogs and blogging as well as swoops through other topics. We, by the way, is like a who’s who of great SQL Server people. I’m not going to post the list just in case everyone doesn’t want to be outed. However, I found the event extremely useful. I have a ton of notes and action items for myself and…
Read More

Communication

Object Relational Mapping, SQL Server, T-SQL, Tools, Visual Studio
It sure seems like there’s a lot of miscommunication between developers and database specialists. In fact, the communication can become so poor that outright hostility between the groups is common. At the end of the day we are all working towards a common goal, to add value to whatever organization we are working for. It's a shame that we all lose sight of this commonality and create such a false dichotomy between the groups. I think there are some ways that we, as database specialists, can use to attempt to cross that gap. Prior to being suborned to the dark side, I was a developer. I had a little over 10 years experience working in VB, Java & C#. I remember, distinctly, cursing our database team for being so problematic…
Read More

Where does slow performance come from?

SQL Server, T-SQL, Visual Studio
I have my opinions and experience, and I’ve no doubt you have yours. Paul Randal (blog|twitter) has put up another one of his interesting surveys to try to collect our opinions and our experience. You should run right over to here and vote immediately. Now that you’ve completed that, I’ll tell you what I think. Based on my experience (neither particularly broad, nor particularly deep, but there has been quite a bit of it), I’ve mostly seen problems in code. When talking about databases, the T-SQL code. When talking about apps, the application code. This is followed not too far back by really poor database structures and poor indexing strategies. I’m sure other people have seen other things, but these really are the areas where I’ve seen the most problems. The one…
Read More

ANSI Connection Settings

SQL Server, T-SQL
It’s reasonably well known that you can get different execution plans if you change the ANSI connection settings. But the question comes up, fairly often, how do you know what the settings are. It’s actually surprisingly simple. They’re stored right inside the execution plan, but they’re in one of the operators that most people ignore. Heck, I used to ignore this operator. Which operator is it you ask? Let’s find out. Let’s use AdventureWorks2008R2 (because I’m lazy). We’ll call one of the stored procedures there like so: EXEC dbo.uspGetBillOfMaterials @StartProductID = 0, -- int     @CheckDate = '2011-03-10 02:31:39' – datetime If you execute this with “Include Actual Execution Plan” enabled you’re likely to end up with the following execution plan: Don’t worry about the fact that you can’t really…
Read More

Execution Plan Stability

SQL Server
I’ve talked before about one of the primary things that the Query Optimizer team at Microsoft tries to avoid, regressions. Basically, they want a plan that worked well in SQL Server 2005 to work well in SQL Server 2008 R2. What’s more, they want everything to work well between service packs, updates and cumulative updates. Ever wonder how they do it? Well, they cheat. OK, that’s mean and not entirely accurate, but it gets the idea across. No, what they do is, identify when they have a breaking change, when they’ve got a special cumulative update or service pack that fixes some bad behavior, but that can cause plans to “break,” they wall it off. Note, in most cases, this “breakage” is actually a question of plans working correctly, but…
Read More

What Should PASS Be?

PASS
Andy Warren posted a question the other day (well, issued a challenge actually), “What Should PASS Be?” I’ll let you go and read that & wait here… Done? Cool. Moving on. I have thoroughly enjoyed my associations with PASS over the years. I’ve been a first-time attendee, a volunteer and a presenter at the PASS Summit. I’ve volunteered with the PASS organization with the Special Interest Groups, the Editorial Committee, and as Editor of the SQL Standard. I’ve taken part in 24 Hours of PASS as a presenter, host and attendee. I have helped to put on SQL Saturday events, attended them and presented at them (and we have another one coming up on April 2nd in the Boston area, please register here.). I was one of the founding officers…
Read More

SQL Rally

PASS
I believe I’ve been far too quiet about this event. In May, in Orlando Florida, there will be a two day SQL Server conference called SQL Rally put on by PASS. This is a somewhat unique event since the sessions have all been chosen by the community. That’s right, a series of votes was held online (and if you missed it, you weren’t paying attention) so that all of you were able to decide which sessions you’d most like to see. I’m bringing this up because, now, it’s up to you to register and go. Did I mention the pre-con? No? Well, there will be a one-day pre-conference seminar. There are multiple sessions of excellent material at the pre-con. These were also voted on by the community. One of them…
Read More

UN-SQL Friday #003–Vendor Love

Misc
The love that dare not speak it’s name… Yes, love for vendors. <shudder> Oh, I mean I love my new employer, but other vendors, no never. Although, there was this one time, at band camp… Well, I don’t think we need to go into the details here, Let me just express a little love for a vendor that might not hit everyone’s radar every day, but one that I use almost daily, especially while I’m working on a book. That’s TechSmith, and their excellent tools Camtasia and Snagit. I was introduced to Snagit by Apress, who required their authors to use the tool while working on screen captures. They even provided a licensed copy. I dutifully installed it and started using it. I was impressed. Although, I found out it…
Read More

SQL Saturday #60, Cleveland Speaker Evals

PASS
I just received 35 speaker evaluations from SQL Saturday #60 in Cleveland. It was a great event (although I had a hard time getting there) and I really enjoyed giving my presentation on “Gathering and Interpreting Performance Metrics” (a warm-up presentation of part of my SQL Rally pre-con). Feedback is a wonderful gift. Thanks to everyone who filled out the eval and especially to those who commented. The evals have six questions and an area for comments. The questions are rated from Very Poor to Excellent. I’ve decided to assign them number values from 1-5. The overall average is 4.82. Here are the breakdowns per question: How would you rate the usefulness of the session information in your day-to-day environment: 4.79 How would you rate the Speaker’s presentation skills: 4.85…
Read More