how do u do Performance tunning ?
Answer Posted / 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 View All Answers
What is the chart in report?
What do we have to check in database testing?
What is the difference between dataadapter and datareader?
If the job running very slow what is the action you do
What is system stored procedures?
How to retrieve error messages using mssql_get_last_message()?
you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration
Why we need to use secondry database file? though, we can do same work using primary database file also.
What is the default order of an order by clause?
What is view in sql?
What are triggers? How do you invoke a trigger on demand?
How to execute the cursor queries with "open" statements?
What are different types of schemas?
Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?
Explain triggers?