C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » General »

SQL database server's FAQs


Posted Date: 16 Oct 2009    Resource Type: Articles    Category: General
Author: Raj Geetaben HarisinhMember Level: Gold    
Rating: 1 out of 5Points: 10



Trades-SQL Optimization Tips

* Use views and stored procedures instead of heavy queries.
This can reduce network traffic because your client sends to server only stored procedure or view name (perhaps some parameters) instead of the big heavy text queries. It can be used to facilitate permission management also, because you want a user to access the table columns may be reduced to not see it.

* Try to use constraints instead of triggers, whenever possible.
Restrictions are much more efficient than triggers and can increase efficiency. Therefore, you should use constraints instead of triggers, whenever possible.

* Use the table variables instead of temporary tables.
Table variables require less locking and logging resources than temporary tables, table variables that should be used whenever possible. Table, the variables are available in SQL Server 2000.

* Try to use the EU countries, the statement instead of UNION, whenever possible.
Union All statement is much faster than the EU, the Union because the petition does not look all Duplicate rows and the Duplicate rows looking statement, either does not exist.

* Try to avoid using a different clause, whenever possible.
Since there are different results in a deterioration in the performance of the clause, this clause is used only when necessary.

* Try to avoid using SQL Server cursors, whenever possible.
SQL Server cursors can result in performance compared to select the statements. Try to use correlated sub-query or derived tables, if the conduct line-by-the-line activities.

* Try to avoid the clause does not apply, if possible.
After the section is used to restrict the result set returned by GROUP BY clause. If you use a GROUP BY clause does not apply to shares the GROUP BY clause groups rows grouped rows and aggregates their values, and then point to prevent undesired aggregated groups. In many cases, you can write your select statement is that only where and GROUP BY clauses without notice. It can improve your query.

* If the number of back row table can be used in another way instead of SELECT COUNT (*) statement.
Because SELECT COUNT (*) certificate to every table full table scan line number back, a very large table in time. There is another way to determine the number of rows in the table. You can use sysindexes system table, in this case. Not ROWS column in the table sysindexes. This column contains the row number for each table in a database. So, you can use the following select statement instead of SELECT COUNT (*): SELECT rows from sysindexes WHERE id = OBJECT_ID (TABLENAME ") and the Indies <2 so you can improve the speed of these issues at different times.

* Include the SET NOCOUNT ON statement on its stored procedures to stop the message the number of rows affected by T-SQL statement.
This can reduce network traffic, because your customers will not notice, specifying the number of rows affected by T-SQL to obtain.

* Try to limit the number of questions about the outcome of using the WHERE clause.
This can result in good performance benefits because SQL Server returns the client only particular rows, not all the rows in the table (s). This can reduce network traffic and to increase the overall performance of the query.

* Use the comments SELECT TOP keyword or the SET rowcount statement, if only the first n rows back.
It can improve your questions, since a smaller number of results returned. It may also reduce the traffic, the server and clients.

* Try to limit the number of questions about the result, returning only the particular columns of the table, not all of the columns of the table.
This can result in good performance benefits because SQL Server returns to the customer but, above all columns, not all of the columns of the table. This can reduce network traffic and to increase the overall performance of the query.



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Sql  .  Server  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: The database driven issue management
Previous Resource: Create a Mysql database to install php script
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use