In continuation of last post of SQL Server: Query Optimization And SQL Tuning, here I write some more tips related to performance tuning.
Look at the DB Schema and see if it makes sense
Most often, Databases have bad designs and are not normalized. This can greatly affect the speed of your Database. As a general case, learn the 3 Normal Forms and apply them at all times. The normal forms above 3rd Normal Form are often called de-normalization forms but what this really means is that they break some rules to make the Database faster.
What I suggest is to stick to the 3rd normal form except if you are a DBA (which means you know subsequent forms and know what you're doing). Normalization after the 3rd NF is often done at a later time, not during design.
There are several problem one can face while working with SQL Server and several strategies used for tuning the performance in SQL Server:
Solution: Increment the total RAM memory to improve the cache hit rate, that is, the number of data pages in memory.
Problem: Full Table Scan found that is used only to find specifics rows.
Solution: Create and maintain indexes.
Problem: Excess Paging detected.
Solution: Add a RAID I/O subsystem or faster disk drives to your server.
Problem: Low Query Execution detected because data tables are very large.
Solution: Partition large data sets and create indexes. This reduces I/O contention and improves parallel operations.
Problem: Low Query Execution detected.
Solution: Tune the SQL queries and programs written in PL/SQL using the techniques explained.
Tune DB settings
You can tune the DB in many ways. Update statistics used by the
optimizer, run optimization options, make the DB read-only, etc... That takes a
broader knowledge of the DB you work with and is mostly done by the DBA.
Using Query Analyzers
In many Databases, there is a tool for running and optimizing
queries. SQL Server has a tool called the Query Analyser, which is very useful
for optimizing. You can write queries, execute them and, more importantly, see
the execution plan. You use the execution to understand what SQL Server does
with your query.
Comments
Post a Comment