Free SQL Server Learning - Backup compression and storage deduplication: A perfect match?
solving sql server problems for millions of dbas and developers since 2006



SQL Server DBA Tips SQL Server Developer Tips SQL Server Business Intelligence Tips SQL Server Career Tips SQL Server Tip Categories SQL Server Tutorials SQL Server Webcasts SQL Server Whitepapers SQL Server Tools SQL Server Questions and Answers MSSQLTips Authors About MSSQLTips SQL Server User Groups SQL Server Events I am MSSQLTips MSSQLTips Advertising Options

MSSQLTips Facebook Page MSSQLTips LinkedIn Page MSSQLTips RSS Feed MSSQLTips Pinterest Page MSSQLTips Twitter Page MSSQLTips Google+ Page









SQL Product Highlight

Melissa Data - Data Quality Components for SQL Server

Data Quality Components for SQL Server are enterprise plugins for SQL Server Integration Services (SSIS) that enable users to verify, standardize, match, consolidate, enhance, and update U.S., Canadian and global contact data including postal addresses, emails, phone numbers and full names. Other capabilities include geocoding, which appends rooftop lat/long coordinates to a street address, and powerful Fuzzy Matching algorithms to link similar records.

Learn more!






































Improve SQL Server Performance with Covering Index Enhancements

By:   |   Read Comments (1)   |   Related Tips: More > Indexing

Problem
The concept of index creation has always been a tricky orchestration.  To maximize performance and indexes by the optimizer, queries should be covered by an index-that is, the index should include all columns requested in the query.  There are limitations to creating indexes that make covering queries difficult:

  • A 900-byte size limit on indexes
  • A maximum of 16 columns can be named in the index
  • Columns with data types like nvarchar(max), text, and ntext cannot be used in indexes

Solution
A new type of index was developed in SQL Server 2005 that assists in covering queries: Indexes With Included Columns.  Indexes with Included Columns are nonclustered indexes that have the following benefits:

  • Columns defined in the include statement, called non-key columns, are not counted in the number of columns by the Database Engine. 
  • Columns that previously could not be used in queries, like nvarchar(max), can be included as a non-key column
  • A maximum of 1023 additional columns can be used as non-key columns

As with traditional non-clustered indexes, the non-key columns are added to the leaf level of the index, meaning these indexes have the same affect on disk space, I/O (due to index maintenance), and cache efficiency.  This should be taken into account when contemplating index creation using included columns. 

How do I create an Index with Included Columns?

Using Microsoft SQL Server Management Studio

Navigate to the index to be modified.  Right-click the index and choose Properties:

Click on Included Columns:

Check the columns you wish to include and click OK:


Using Transact-SQL:

Next Steps



Last Update: 9/29/2006

About the author

Edgewood Solutions is a technology company focused on Microsoft SQL Server and founder of MSSQLTips.com.

View all my tips


Print  
Become a paid author


Comments and Feedback:

Wednesday, March 11, 2009 - 10:49:46 PM - arbalu Read The Tip

thanks for this post.  i found that it was very useful tips to me.

 balu

http://developerskb.blogspot.com



Post a Comment or Question

Keep it clean and stay on the subject or we may delete your comment.
Your email address is not published. Required fields are marked with an asterisk (*)

*Name   *Email Notify for updates

Signup for our newsletter


Comments
*Enter Code refresh code


 
Sponsor Information
Find and fix SQL Server problems before they happen - SQL diagnostic manager now with predictive analysis!

SQL Developer Bundle: Cut out dull work with 12 tools for simpler, faster database development. Free trial

What grade do you think your SQL Servers get? Find out with Edgewood's Health Check consulting services.

Free SQL Server performance monitoring software! Improve performance by 65% today with IgniteFree.

Free SQL Server Learning - Lock Down SQL Server Security


Copyright (c) 2006-2013 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | about
authors | contribute | feedback | giveaways | user groups
Some names and products listed are the registered trademarks of their respective owners.


Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com