This is more of a “what I’ve been reading” rather than a link dump from previous week’s RSS feed. A Plea for Plain English – Tony Davis’s “A Plea for Plain English” rings home with me. Far too much writing is full of heavy, pompous words used purely to make the author feel smarter. Joseph Conrad – one of the greatest writers of the English language – was not a native speaker.
Refactoring SQL code can be pretty easy. Just like refactoring any other programming language, sometimes you have to look around to find the culprit. We have a slow running query that frequently times out when run by the users. A quick look at the query told me what was wrong. I found this clause in the middle of an otherwise simple query:``` LEFT JOIN ( SELECT DISTINCT key, column_a FROM ImportantData WHERE FieldName = ‘VALUES’ UNION ALL SELECT DISTINCT key, column_a FROM ImportantData_History WHERE FieldName = ‘VALUES’ ) AS t ON other.
Execution plans are great things. They give us an insight into how SQL Server is putting together queries and why they run slowly. One immediate thing I look for in an execution plan is a Key Lookup. In a Key Lookup operation, SQL Server has to reference the clustered index on the table because a value it’s looking for is not present in the index that was used to find the row.
Paul Randal started this chain post. He tagged Steve Jones who, in turn, tagged Jack Corbett who finally tagged me. I’m pretty sure everyone who nominally makes sense has already been tagged at this point thus leaving Jack to scrape the bottom of the barrel. Like Jack, I think I could approach this in a number of different ways. I think I’ve already answered the professional route that I took. If I haven’t, it’s probably because my professional route isn’t all that interesting and it’s also all available on LinkedIn.
In the IT field, people have the expectation that we’ll always have an answer or a solution. The problem is that we usually don’t have the answer. A lot of the time, we don’t even have the beginnings of a clue. Your reaction when you don’t have an answer speaks volumes. I’m going to use a story to illustrate this point.
The Story Adam and Bill work together at Amalgamated Spats.
In case you haven’t heard, there is a huge difference between the way that software developers and database professionals operate – there are accepted use paradigms and development methodologies for both worlds. Unfortunately for everyone, they don’t match up. Object-oriented programming languages operate on single entities: objects. Databases work with sets. Objects sometimes have relationships that are difficult to effectively map in a relational database. Database entities frequently do not even correspond to application entities.
Thomas LaRock thought it would be fun to tag me in yet another round of blogging bingo, this time to answer the question “What are you Goals and Theme Word for 2010?”. To tell the truth, I have not made any kind of New Year’s Resolution for a number of years. I usually review my goals on a regular basis, but let’s put them out here for everyone to see. Theme word?
Long story short: I need the ISO Week. We need to be able to make sure that when we’re reporting, we’re pulling data for the full week (which happens to coincide with ISO Week at my employer). The problem with using an existing function is that the existing functions just return the week and not the full year + week combination. I used the function from the Less Than Dot wiki as a starting point and added my own code to create the full YYYYWW string to give me an ISO Week.
It’s time for a personal message from your friendly Director-Elect-at-Large. In about a week, I’m going to be taking on my first year of duties as a Director-at-Large of PASS. What are those duties? I’m going to be overseeing the program efforts for the 2010 PASS Summit. I’ll be working closely with an established team of volunteers to make the upcoming Summit an amazing experience for everyone. Outside of PASS, what have I been doing?
PowerShell Today Allen White recently presented for CBusPASS about PowerShell. First off, I’d like to say thanks to Allen for driving down from Canton, OH to speak in person. He took the time to stick around afterwards and chat about a bunch of things that were on user group members’ minds. Allen’s presentation covered the basics of PowerShell through concrete examples – automating backups, restores, and database creation. Throughout the entire process, Allen demonstrated many aspects of PowerShell that make the DBA’s life easier.