Database Performance Tips for Faster SQL | Database Journal

Database Performance Tips for Faster SQL

Apr 2, 2010
2 minute read

SQL developers, no matter which relational platform they’re coding on, all face the same problems in keeping up database performance. Some of these problems result from getting stuck in particular methods, not exploring other methods, queries only running well on test data, or production issues not taken into account when the code was written. Of course, every system has different issues and there is no perfect way to tune queries. However here are some tips to help keep database performance at its peak.

Some things to NOT do include:

  • Using UPDATE instead of CASE when inserting data and needing it to display a certain value if another value exists
  • Copying someone’s code that pulls the data you need, but also a large amount that’s unneeded
  • Querying a large table twice for related results and then later joining them together in a temp table

While some things TO do are:

  • Pull only the exact columns you need, it’s much more efficient to type a few names than to process a whole table when you only need a few rows, and resources aren’t stolen from other processes either
  • Know when it is beneficial to use temp tables, such as when subsets of large tables need to be joined and multiple queries run on them
  • Pre-stage data by joining tables and persisting them ahead of time when multiple similar joins will be done on them
  • Delete or update large amounts of data in batches
Database Journal Logo

DatabaseJournal.com publishes relevant, up-to-date and pragmatic articles on the use of database hardware and management tools and serves as a forum for professional knowledge about proprietary, open source and cloud-based databases--foundational technology for all IT systems. We publish insightful articles about new products, best practices and trends; readers help each other out on various database questions and problems. Database management systems (DBMS) and database security processes are also key areas of focus at DatabaseJournal.com.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.