Quick Tip: Remove CONVERT\CAST from your WHERE\JOIN clauses

Quick Tip Remove CONVERT/CAST from your WHERE clauses and JOINS when comparing to variables of different data types. Set their data types to match your table definitions before using them as a filter. Optimizing your queries this way will greatly reduce the amount of CPU time, reads, and I/O generated in your queries and allow your code to take better advantage of indexes. Example We are going to create a very simple stored procedure called ConvertExample. In this procedure we will see two things. One, the first procedure we create will declare two variables as VARCHAR( MAX) data types, then… Continue Reading

Mastering TempDB: The Basics

I regularly deliver a presentation called “Mastering TempDB”. I wrote it based on what I wish I knew about TempDB “growing up” in my career as a SQL Server DBA. It really is a breakdown of what TempDB is, how it is used, what problems actually occur within it, and how to best configure it. With advice from my colleagues, I have decided to break that down into this article to educate you. What is TempDB? TempDB is a global resource used by everyone and everything inside SQL Server. Think of it as a dumping ground for anything that doesn’t… Continue Reading

Install ALL Things SQL Server… What?

Does your server look like this? Many of us have inherited a SQL Server instance that has all SQL Services installed. Someone, maybe even you, went through the SQL Server installation process using GUI and checked every option available to them, then just clicked Next, Next, Next and then Install. If this is your environment, please take a moment to evaluate and decide which of these services that are required. From a performance tuning perspective, it is important to only run the services that you need. Each of these services can consume resources on your server. Sharing resources reduces what… Continue Reading

Invest in Yourself Stop Making Excuses

Bob Pusateri (B|T) tweeted a quote image that really struck a chord with me and elicited a strong reaction from myself. It got me thinking I need to write a blog on this, so here we go. Many times, over the years I’ve had conversations with people in which they have said things like below. “I can’t learn anything new because my work won’t send me to training” “I can’t learn about xyz because my boss or coworkers won’t sit down with me to show me how” “I don’t have time to learn anything new” “We’ll never go to the cloud,… Continue Reading

Are My SQL Server Indexes Being Used?

Indexes can be incredibly beneficial to your database performance; however, they do come with a cost—indexes both consume storage space and affect insert performance. Therefore, it is important as part of your index maintenance procedures that you periodically check to see if your indexes are being used. Many times, indexes are created in the belief they are needed but in fact they are never used. You can reduce that IO overhead on inserts when you remove unnecessary indexes. How Do You Find Them? Glenn Berry (B|T) has a fantastic script as part of his diagnostic scripts (link) that helps identify… Continue Reading

Editorial – Dealing with Ugly Babies

One thing I learned while working as a database administrator over 17 years is the importance of teamwork across departments. Many times, we have to rely on network and SAN administrator to make changes to their environments in order to make SQL Server run more efficiently. There are times where the storage and network create bottlenecks for SQL server and after doing all the possible tuning you can do with your code and configuration you must turn to them for modifications to their hardware. Knowing how to effectively work with other departments without placing blame is crucial. As most do,… Continue Reading

Live, Learn, and Grow

Ever look back at old work and wonder what was I thinking when I did that? Or even better you mock and get disgusted over some code you stumble upon and then realize you wrote it? Today is one of those days. Lucky for me one of my clients is a company I used to work for. It’s awesome to be able to go back and work in an environment you are familiar with. However, with that, you realize when you worked there you made some decisions or wrote some code that you now shake your head at. On the… Continue Reading

Maintaining Balance

Last week, I got the chance to give my I’m It Survival Tips for the Lone DBA  in a webcast for the first time thanks to the PASS Women in Technology Virtual Chapter. This is by far my favorite session to give because it’s real life and can pertain to all us. Whether you are a Lone DBA or part of a team, we all encounter the struggles when handling a heavy work load. I always love the interactions I get from this session. It allows us to share our stories and learn from each other. As a Lone DBA you are on call… Continue Reading

It’s All in the Name, Index Naming Conventions

Awhile back, if you are on Twitter, you can probably recall my ranting about the 949 indexes I was reviewing. The process was to determine duplicate indexes and consolidate them or discard the unneeded ones. My ranting was not about the duplicates per se it was about the index names. It only takes a second to name an object with some name that tells what the thing is. Below I will show you some examples and give you an easy script that will help you generate your index names. Taking a little time to name things appropriately can go a… Continue Reading

AHHH I need a Blog Topic!!!

One of the hardest things you can do as a blogger is to come up with a post topic. Do you make it simple for newbies, technical, or something personal?  After figuring out a topic, now you have to write.  However, there is a difference in what you say and what will people actually want to read. Blogging is not easy, but without it, all of our google searches to help solve problems would be much less fruitful.   It’s important to put your experience into written words to help others, and let’s be honest lots of us use out blog… Continue Reading