ComputerUser.com

SQL Optimization Tips and Index Optimization Tips | tutorials Conway AR

All the tips provided on this website about indexing and SQL Optimization are general guidelines. As with any general guideline, there are exceptions. Because of this, it is a good idea to test out various indexing strategies for the most common queries run against your database.

Ridge Marketing Group
(501) 336-0444
Conway, AR
Lms Inc
(870) 429-6322
Western Grove, AR
Creative Environmental Inc
(501) 851-2182
101 Murphy Dr
Maumelle, AR
Deviney Gary Computer Services
(479) 478-9000
7815 S 25th St
Fort Smith, AR
Electronic Data Systems Inc
(501) 374-6608
500 President Clinton Av
Little Rock, AR
Acxiom Corporation
(501) 336-1000
301 E Dave Ward Dr
Conway, AR
Tromik Technology Corp
(501) 945-5003
2504 McCain Blvd Ste 108
North Little Rock, AR
Saberex Group Ltd
(479) 631-8077
101 E New Hope Rd
Rogers, AR
Quadrivium
(479) 872-6473
Springdale, AR
I Tmc
(479) 927-3636
518 Holcomb St
Springdale, AR
Provided By:

SQL Optimization Tips and Index Optimization Tips | tutorials

Written by Vijay Patil   
Article Index
SQL Optimization Tips and Index Optimization tips
QUERIES
STORED PROCEDURES
TRIGGERS AND VIEWS
TRANSACTIONS AND OTHERS
TOOLS AND PERMISSIONS
Permissions
All Pages

All the tips provided on this website about indexing and SQL Optimization are general guidelines. As with any general guideline, there are exceptions. Because of this, it is a good idea to test out various indexing strategies for the most common queries run against your database

T-SQL Optimization Tips

  • Use views and stored procedures instead of heavy-duty queries.
    This can reduce network traffic, because your client will send to server only stored procedure or view name (perhaps with some parameters) instead of large heavy-duty queries text. This can be used to facilitate permission management also, because you can restrict user access to table columns they should not see.
  • Try to use constraints instead of triggers, whenever possible.
    Constraints are much more efficient than triggers and can boost performance. So, you should use constraints instead of triggers, whenever possible.
  • Use table variables instead of temporary tables.
    Table variables require less locking and logging resources than temporary tables, so table variables should be used whenever possible. The table variables are available in SQL Server 2000 only.
  • Try to use UNION ALL statement instead of UNION, whenever possible.
    The UNION ALL statement is much faster than UNION, because UNION ALL statement does not look for duplicate rows, and UNION statement does look for duplicate rows, whether or not they exist.
  • Try to avoid using the DISTINCT clause, whenever possible.
    Because using the DISTINCT clause will result in some performance degradation, you should use this clause only when it is necessary.
  • Try to avoid using SQL Server cursors, whenever possible.
    SQL Server cursors can result in some performance degradation in comparison with select statements. Try to use correlated sub-query or derived tables, if you need to perform row-by-row operations.
  • Try to avoid the HAVING clause, whenever possible.
    The HAVING clause is used to restrict the result set returned by the GROUP BY clause. When you use GROUP BY with the HAVING clause, the GROUP BY clause divides the rows into sets of grouped rows and aggregates their values, and then the HAVING clause eliminates undesired aggregated groups. In many cases, you can write your select statement so, that it will contain only WHERE and GROUP BY clauses without HAVING clause. This can improve the performance of your query.
  • If you need to return the total table's row count, you can use alternative way instead of SELECT COUNT(∗) statement.
    Because SELECT COUNT(∗) statement make a full table scan to return the total table's r...

Click here to read the rest of this article from Computer User