MSSQLCity.Com - All about MS SQL
     
About Us  
SSWUG Articles  
Articles  
FAQ  
Scripts  
Tips  
Application  
Backup/Restore  
Bulk Copy  
Cursors  
DTS  
Indexes  
File/Filegroups  
Full-Text  
Server settings  
Db settings  
WinNT tips  
Tables design  
T-SQL  
Miscellaneous  
Replication  
Stored proc  
SQL 2000  
SQL 6.5  
OLAP  
Test Exams  
Advertise  
Download  
History  
Search  
Traffic  
Related Links  
     
Your button logo
Add to Favorites
 
     
 

SQL Server 2000 Optimization Tips

    *****

  • For the very large databases, use distributed partitioned views to partition tables horizontally across multiple servers.
    This is a new SQL Server 2000 feature, which is available when using SQL Server 2000 Enterprise Edition only. Due to distributed partitioned views, SQL Server 2000 now on the first place in the TPC-C tests.


  • *****

  • Use indexed views to increase the speed of your queries.
    The result set of the indexed view is persist in the database and indexed for fast access. Because indexed views depend on base tables, you should create indexed views with SCHEMABINDING option to prevent the table or column modification that would invalidate the view. Furthermore, using views instead of heavy-duty queries can reduce network traffic and can be used to facilitate permission management.


  • *****

  • Consider using the WITH SORT_IN_TEMPDB option when you create an index and when tempdb is on a different set of disks than the user database.
    Using this option can reduce the time it takes to create an index, but increases the amount of disk space used to create an index.


  • *****

  • You can specify whether the index keys are stored in ascending or descending order.
    For example, using the CREATE INDEX statement with the DESC option (descending order) can increase the speed of queries, which return rows in the descending order. By default, the ascending order is used.


  • *****

  • Consider creating index on computed columns.
    In SQL Server 2000, you can create indexes on computed columns. To create index on computed column, the computed column must be deterministic, precise, and cannot has text, ntext, or image data type.


  • *****

  • Consider setting the 'text in row' table option.
    The text, ntext, and image values are stored on the Text/Image pages, by default. This option specifies that small text, ntext, and image values will be placed on the Data pages with other data values in a data row. This can increase the speed of read and write operations and reduce the amount of space used to store small text, ntext, and image data values. You can set the 'text in row' table option by using the sp_tableoption stored procedure.


  • *****

  • Use table variables instead of temporary tables.
    The table variable is a new SQL Server 2000 feature. The table variables require less locking and logging resources than temporary tables, so table variables should be used whenever possible.


  • *****

  • Use cascading referential integrity constraints instead of triggers, whenever possible.
    For example, if you need to make cascading deletes or updates, you can specify ON DELETE or ON UPDATE clause in the REFERENCES clause of the CREATE TABLE and ALTER TABLE statements. The cascading referential integrity constraints are much more efficient than triggers and can boost performance.


  • *****

  • If you work with SQL Server 2000 Enterprise Edition use SAN (System Area Network) protocols instead of LAN (Local Area Network) or WAN (Wide Area Network).
    SANs are more reliable than LANs or WANs and support high levels of messaging traffic by lowering CPU loads and message latency.


  • *****

  • Use user-defined functions to encapsulate code for reuse.
    The user-defined functions (UDFs) contain one or more Transact-SQL statements that can be used to encapsulate code for reuse. Using UDFs can reduce network traffic.


  • *****

  • Set the 'awe enabled' server configuration option to 1 if you work with SQL Server 2000 Enterprise or Developer edition and have more than 4 gigabytes (GB) of physical memory.
    Because SQL Server 2000 can support up to a maximum of 64 gigabytes (GB) of physical memory, you can purchase the appropriate server box and get all advantages of it hardware platform.


  • *****

  • Use the DBCC CHECKCONSTRAINTS statement if you need to check the integrity of a specified constraint or all constraints on a specified table.


  • *****

  • Use the DBCC INDEXDEFRAG statement to defragment clustered and secondary indexes of the specified table or view.
    DBCC INDEXDEFRAG statement is an online operation. Unlike DBCC DBREINDEX, DBCC INDEXDEFRAG does not hold locks long term and thus will not block running queries or updates. So, try to use the DBCC INDEXDEFRAG command instead of DBCC DBREINDEX, whenever possible.


  • *****

  • You can use INSTEAD OF triggers to perform enhance integrity checks on the data values.
    The INSTEAD OF trigger is a new SQL Server 2000 feature. These triggers can be used to enforce business rules when constraints cannot be used.

    Note. Because triggers are more resource expensive, use constrains instead of triggers, whenever possible.


  • *****

 

 
Visit The SQL Server Worldwide User's Group for all the latest news and information about SQL Server, Oracle, DB2 and XML for developers and administrators.

(c) 1997, 2010 Bits on the Wire, Inc