Database Optimization


Database efficiency is often overlooked by programmers as well as web designers. It is quite common not to optimize the database. Improving the efficiency of database can have a big impact on its long term stability. Having the right structure and data type is the building block for an efficient database and is mandatory for any professional web application.

Database management systems are pervasive in the modern world. The notion of a persistent, redundant, and highly distributable library of information has become the single most important concept in our information technology repertoire. In fact, virtually every human being in the Western world interacts with a database management system of some kind on a daily basis—often without using a personal computer at any time throughout the day.

The purpose of this paper is to discuss basic database optimization using mathematical cost estimation for different types of queries, a review of join performance, and the effects of various physical access structures on specific query examples. The intended audience should be familiar with SQL and basic relational database concepts – typically an experienced database developer. Specific examples will be given in the context of MS SQL Server 2005, but the concepts they illustrate will be general enough to apply to any SQL-supporting relational DBMS (Database Management System).

Optimization Tools

  • DB Optimizer is a SQL validation tool that examines SQL queries to uncover inefficiencies and offers alternatives to improve SQL performance and prevent poor-performing SQL from ever reaching the production environment.

  • J Optimizer is a Java profiling tool designed to find and fix code problems earlier in the development process. Dynamic code analysis tools identify performance problems such as potential race conditions and unchecked exceptions, and memory and CPU bottlenecks. Advanced code metrics reveal the quality and complexity of the code structure to quickly pinpoint potential problem areas.

  • Performance Center is a 24x7 database monitoring tool that tracks and reports on all aspects of database activity like memory, I/O, contention, space, network, objects, users, and SQL code to pinpoint performance problems.

  • Schema Examiner is a design or architecture validation tool that looks at the structure of the database to find improper indexing, normalization problems and other relational modeling errors that impact database performance.