• subscribe
February 18, 2004 12:00 AM

54 Administration Tips

Great DBA hints, past and present
SQL Server Pro
InstantDoc ID #41533
Downloads
41533.zip

Don't Index Wide Columns
If a table's columns are wide (i.e., the columns have a data type of char(25) or larger), indexes created on those columns might result in a large number of pages, thereby negating the benefit of using an index in the first place. Nonclustered indexes in SQL Server 2000 and 7.0 are structured differently from those in earlier releases. If you're not careful, you can create indexes that take more space on disk than the original data pages. (For more information about changes in index structure and the possible detrimental effect on your database, see "Move Up to SQL Server 2000," by Michelle A. Poolet and Michael D. Reilly, February 2002, InstantDoc ID 23512.)

Help the Optimizer Help You
The query optimizer can't do its job well without the right tools and an environment that lets it choose from a broad range of possibilities. Here are a few guidelines to help you supply the right tools:

  • Create indexes on frequently joined columns. Clustered indexes enable merge joins and fast lookups with nested-loop joins.
  • Create covering indexes on combinations of frequently fetched columns. These indexes satisfy queries from the index's leaf level, and you can use them as input for merge joins if the first index column is also the join column.
  • Create indexes with care, especially covering indexes. Indexes improve performance of SELECT queries but degrade performance of modification operations.
  • Avoid performing joins on columns with few unique values. These joins can be more costly than table scans, so the query processor might decide not to use them.
  • Separate tables that participate in joins onto different disks by using filegroups to exploit parallel disk I/O.


ARTICLE TOOLS

Comments
  • smita deshpande
    8 years ago
    Apr 20, 2004

    Nice article

  • Nate
    8 years ago
    Mar 12, 2004

    Good stuff!

You must log on before posting a comment.

Are you a new visitor? Register Here