The Result Data Newsletter   
Volume 701 - January 2007   
© Copyright 2007 Result Data Consulting, Ltd.  614-505-0770  www.resultdata.com   

    Result Data Home Page  |  Newsletter Archive  |  Upcoming Events  |  Classes & Workshops  |  Request Information
 Upcoming Events:  Feb 8: MOBOUG User's Group,  March 7: Microsoft BI Seminar,  April 11: Business Objects Seminar

Return to Newsletter Contents...

 

Improving SQL Server Performance

by: Charles Tournear, Senior Consultant, MCSE, MCSD, CRCP, MCDBA, MCT 

 

The speed and performance of a SQL server is dependent on three areas; hardware speed and configuration, database design, and application or query design.

   

Hardware

   

A SQL server needs fast processors to manage a large number of queries. Most people look for systems with a lot of memory and fast processors. One thing in configuring multi-processor systems that is often overlooked is that the disk access is controlled by the operating system and not the SQL Server service. Performance for disk access for loading data and accessing virtual memory can be improved by dedicating one processor or at least 25% of the processing capability to the operating system. For example, if you have a system with 4 CPUs, only allow the SQL Server to use CPU 1, 2, 3 and let the operating system have the lower numbered processor
CPU 0.

   

Database Design

   

Database design can greatly affect the speed of processing a query. The number of tables that have to be joined to retrieve the data you need in a query affects the speed of the query processing. Try to keep the number of tables needed for most queries to a minimum. If a table is being used primarily as a lookup or restriction on data choices, consider keeping the data itself in the main table instead of having to link to the table with an id number to retrieve the data. You can still use a foreign key to protect the data allowed, but you won’t have to join to the table for queries.

   

Another area to consider is the maximum page size and maximum row size for data storage when designing tables. For example, Microsoft SQL Server has a maximum row and page size of 8060 bytes. So if you created a single table with a total row size of 4100 bytes, the maximum number of rows that would fit per page would be one and there would be 3960 bytes per page of wasted space. It would be more efficient if the single table of 4100 per row could be broken down into multiple tables. For example 2000 (allowing 4 rows per page) and 2100 (allowing 3 rows per page) thus reduces the amount of wasted space in the database.

   

When there is a one-to-many relationship between two tables that will be joined often to lookup a record in the one and return the associated many from the other table, the more records that can fit per page on the many side can improve the speed of returning the related data. Creating indexes on the columns that define the join will also help in the retrieval of data.

   

Application and Query Design

   

When designing an application that retrieves data from a SQL Server data source, try to work in a disconnected process. If you maintain a connection to the server while the application is running, most connectors poll the server every 15 minutes just to verify that the server is still available. This extra network traffic can slow down all other activities that also require network access. Also try to be precise about the data that needs to be retrieved. Always use a WHERE clause to reduce the amount of data to be returned. The more data returned the longer the server is tied up processing your query and the longer you are blocking other requests. Also never use the * with SELECT. List only those columns that you actually need to use after the SELECT to again reduce the amount of data being returned. Even if you do want to retrieve all the columns, list the column name instead of using SELECT *. The * has to be resolved to an actual list of names before the query can begin to be processed, which can require additional trips back and forth from the client and server.

 

Go to Top  |  Return to Newsletter Contents

The Result Data Newsletter is published approximately once a month to share the latest information on business intelligence data management and CRM. There should be a link below to allow you to change or remove yourself from our list. We take your requests very seriously. If you have any difficulty please contact us at 614-505-0770 and we will make sure that your request is handled properly. This is not intended to be an unsolicited message and you can reach us in person if needed.

© Copyright 2007 Result Data Consulting, Ltd. - All Rights Reserved
All trademarks and copyrights are the property of their respective owners. This information is provided without warranty.
Announcements
New Classes at Result Data
With the new year comes new classes at our award winning training center. New classes for Q1 '07 include:

Xcelsius: Designing Interactive Presentations Certified Class

Microsoft SQL Server Integration Services Workshop

Microsoft SQL Server Analysis Services Workshop

Click on the class name to get information on dates or to register.
Microsoft Business Intelligence Seminar
Join us to learn about the new Business Intelligence technologies on the way from Microsoft. The seminar will be held on March 7th at the Microsoft Polaris office. Please check our web site for the agenda and to register. This free 1/2 day seminar will run from 8:30AM to noon. Click here to register.
Quality Control for Dummies
This book, part of the best-selling "Dummies" series from Wiley, has just been released. Co-authored by Michael Wallace, Principal Consultant at Result Data.
Private Training Classes & Mentoring
Ask us about our private classes and mentoring services and how they can help your team get up the curve fast. 
Next MOBOUG Meeting
The next Mid-Ohio Business Objects User Group (MOBOUG) meeting is February 8th, 2007.  Call 614-505-0770 or click here to reserve your seat
Looking for a Few Good Men and Women
Join our award winning team of Business Intelligence consultants and .Net Software developers.

Send your resume and salary requirements to: jobs@resultdata.com