how do u do Performance tunning ?



how do u do Performance tunning ? ..

Answer / bhaskar

• Table should have primary key
• Table should have minimum of one clustered index
• Table should have appropriate amount of non-
clustered index
• Non-clustered index should be created on columns of
table based on query which is running
• Following priority order should be followed when
any index is created a) WHERE clause, b) JOIN clause, c)
ORDER BY clause, d) SELECT clause
• Do not to use Views or replace views with original
source table
• Triggers should not be used if possible,
incorporate the logic of trigger in stored procedure
• Remove any adhoc queries and use Stored Procedure
instead
• Check if there is atleast 30% HHD is empty - it
improves the performance a bit
• If possible move the logic of UDF to SP as well


• Remove * from SELECT and use columns which are only
necessary in code
• Remove any unnecessary joins from table
• If there is cursor used in query, see if there is
any other way to avoid the usage of this (either by SELECT
… INTO or INSERT … INTO, etc)
There are few hardware upgrades can be considered as well
like separating index on different disk drive or moving
tempdb to another drive. However, I am not suggesting them
here as they are not quick way to improve the performance
of query.

Is This Answer Correct ?    6 Yes 1 No

Post New Answer

More SQL Server Interview Questions

How to retrieve range of 10th rows to 20 th rows from total rows from a database table.? (Not from Dataset)

10 Answers   Cognizant, Infosys,


What the class forname () does?

0 Answers  


What are the lambda triggers?

0 Answers  


Is it possible to have clustered index on separate drive from original table location?

0 Answers  


How can you start sql server in different modes?

0 Answers  






Can we rewrite subqueries into simple select statements or with joins? Example?

2 Answers   ASD Lab,


Find top Nth employee from each department in terms of salary?

13 Answers   RealPage,


What is the purpose of sql profiler in sql server? : sql server database administration

0 Answers  


Where do we use trace frag?

0 Answers  


How do triggers work?

0 Answers  


How to include text values in sql statements?

0 Answers  


How many clustered indexes there can be on table ?

0 Answers  


Categories