SQL Performance Tips

by Andrew H
I read an article by Craig Mullins called, SQL Performance Basics. I chose the article because I was searching for SQL statement articles and it was closer to the top and the fact that it has to do with performance caught my eye. The article states that as much as 75% of poor relational performance is caused by poorly coded SQL. The article goes through a few different ways to help increase performance as well as how to avoid coding SQL poorly. As the author says with proper training and experience coding it in an efficient way is not hard but can still be an elusive task for many coders. Some of his simple tips to create an efficient database are, to think relationally, code join instead of implementing cursors for every table that is going to be read, always provide only the exact columns that you need to retrieve, and filter data using a where clause. To always provide the exact columns that you need the author says to use a SELECT statement in SQL but don’t have use SELECT* as this is a bad practice for programs because that statement will┬áretrieve all columns from the tables being accessed. The WHERE clause is important because you should filter what data you need out before bringing it in to your program, as this will greatly increase the speed of your application.

I thought this article was interesting and important because as we learn how to write SQL statements we need to figure out what will increase or decrease performance so that we do not make mistakes and cause glitches in our databases. Both the SELECT and WHERE statements are important to us because I’m sure we all want to create a database that does not pull excess data that is not need and get slowed down by it, so I will make sure that I do not use the generic SELECT statements whenever possible.

Mullins, C. (Dec 2010). SQL Performance Basics. Database Trends and Applications, 24.

4 thoughts on “SQL Performance Tips”

  1. I think this was a good article because it gives some sort of ideas on how to avoid mistakes when working with SQL statements. It provides information for us to consider now that we are in the middle of a SQL project so that we avoid writing poor SQL statements.

  2. This is very good advice for people who are coding databases. I found it interesting that through the quarter, there have been several articles talking about different systems and methods, but all talk about the design or coding aspect of it. You can be a fantastic coder and understand the dynamics of a system, but if you don’t properly design it right from the beginning, you are definitely going to have a hard time later with the particular system. Fundamentals really are the most important.

  3. I believe that this article provides an insight on how to become an effective database programmer. Even though it is convenient to use generic SELECT statements, it may be improper from security perspectives as well. Also, when one is dealing with large amount of data, I believe that it is pointless not to filter them.

  4. This is a great article for both people who are starting out and professionals. It’s always a good reminder when we’re initiating queries that 75% of performance comes from our coding. By keeping these little hints in mind, we could better avoid making simple mistakes that could cost us an entire project.

Comments are closed.