Top 10 SQL Performance Boosters: Increase SQL Server Performance With The Hardware You Already Own
Top 10 SQL Performance Boosters: Increase SQL Server Performance With The Hardware You Already Own
Top 10 SQL Performance Boosters: Increase SQL Server Performance With The Hardware You Already Own
TOP 10 SQL
PERFORMANCE BOOSTERS
INCREASE SQL SERVER PERFORMANCE
WITH THE HARDWARE YOU ALREADY OWN
BY MICHAEL K. CAMPBELL
WHITEPAPER
WHITEPAPER
as the OS lays claim on the other 2GB for itself. For 32-bit systems, Microsoft
provided Physical Address Extensions (PAE) which let applications have up to
3GB of RAM (forcing the OS to use just 1GB), but thats hardly much of a benefit
on systems with over 4GB of physical RAM that cannot be addressed by the OS.
Consequently, for larger systems, Address Windows Extensions (AWE) were
created to extend the window, or size, of addressable memory in order to
allow 32-bit applications to address as much as 128GBs of RAM on 32-bit
versions of Windows Enterprise and Data Center Editions. The only drawback
to AWE memory is that it is not dynamically managed through Windows
paging functionality the way normal, virtual, memory would be. Consequently,
applications requiring more than 2GB of RAM need to be granted the Lock
pages in memory User Right through the Local Security Policy.
Sadly, the installation wizard for 32-bit versions of SQL Server does not call
awareness to this fact or present administrators with the option to configure
AWE during setup. Moreover, even if Admins or DBAs grant SQL Server access
to more than 2GBs of RAM using Enterprise Manager, SQL Server Management
Studio, or T-SQL, those directives cannot be honored by SQL Server until its
service account has been granted the Lock pages in memory user right. As
such, large numbers of 32-bit SQL Servers run with access to only 2GBs of RAM
when frequently there is much more physical memory available.
To spot check for this problem on 32-bit hosts, check Windows Task Manager
and determine whether your system has more than 2GB of physical memory
and you only see 2GB of memory. This is indicative of the issue, but it is quite
easy to correct. Simply grant your SQL Servers service account the Lock pages
in memory user right, reconfigure your SQL Server to use more RAM (if you
have not already done so), and restart SQL Server service so that it can take
advantage of the additional RAM. I have provided step-by-step instructions for
correcting this problem online, and remedying this problem will provide huge
performance benefits with very little effort.
WHITEPAPER
WHITEPAPER
4. RAID Levels
If you have addressed block-sizes and partition offsets and are still running into IO
performance problems, another key consideration is that not all forms of RAID are
created equal.
RAID-0 is extremely dangerous in any production SQL Server environment and should not be
used. Using it to approximate production-level speeds in testing environments in some cases
may make senseotherwise, steer-clear of RAID-0 entirely. And do not fall prey to the notion
that you can use a RAID-0 for your tempdb if a single disk fails in that array your entire
server will go down, since SQL Server cannot run without a viable tmpdb.
http://technet.microsoft.com/en-us/library/cc966412.aspx
WHITEPAPER
WHITEPAPER
deployments to saturate network connections. But that does not mean that
minor modifications and network configuration changes to existing hardware
cannot yield big performance improvements.
6. Jumbo Frames
Standard Ethernet frames are limited to 1,500 bytes per payload, which require
overhead to manage when sending out large streams of data, since that data
has to be chunked into small payloads. Jumbo Frames overcome this issue by
boosting the amount of data per payload up to 9,000 bytes, thereby reducing
the processing and management overhead needed to send data back and forth
across the wire.
Setting up Jumbo Frames on a Gigabit (or better) network can be tricky, and it
is not uncommon to run into problems while attempting configuration changes.
Youll want to schedule downtime and plan and test accordingly before making
this change in production environments . Jumbo Frames may be one way to
increase overall performance and responsiveness if you are constantly sending
larger blocks of data from 64-bit SQL Servers to 64-bit application servers (for
reporting or other, similar, purposes).
Maintenance
There is no denying the impact that a full-time DBA can have when it comes to
managing performance considerations and needs, especially through finelytuned and well-regimented maintenance plans. But in organizations where a
DBA is not warranted (such as when databases are small), or is not available,
the automation of regular maintenance tasks can provide tremendous
performance benefits.
7. Updating Statistics
One thing that makes SQL Server so successful is its phenomenal internal
query execution engine, which relies on complex statistics about the nature,
cardinality, and density of data to speed the execution of queries. However,
without regularly updated statistics, SQL Servers ability to properly determine
the most efficient approaches to satisfying a query starts to wane. SQL Server is
WHITEPAPER
WHITEPAPER
once), meaning that the density of this index would be .001 (or 1 out of
1,000), giving it perfect selectivity.
One the other hand, an index on the Gender column of the same table would
be a very poor index because it only has two unique values, and (in most
cases) would have a fairly even distribution of values throughout the table,
making the index largely useless when it comes to querying data. In fact, as
a rule of thumb, unless an index is a covering index (covered in the next tip),
SQL Server will not use an index with a selectivity of less than 90%, meaning
that it should be removed.
To calculate index density and, thereby, specificity, use the DBCC SHOW_
STATISTICS command against a target index on a given table. For example, to
check on one of the indexes mentioned previously, you should run the following:
DBCC SHOW_STATISTICS(Employees, IX_Employees_
ByGender)
Then, in the first set of results, check the Density column along with the All
density columns from the second-set of results. Remember that these values
are in exponential notation (so 1.166079E-06 is actually 0.00001166709)
whenever there is an E-0x in the results. Otherwise, as long as the density value
returned is less than .1 (i.e. a selectivity of more than 90%), it is a pretty safe
assumption that the index is selective enough to be used in most cases.
Of course, it is also possible that some highly selective indexes exist but
never get used because no queries are ever fired against the columns being
indexed. Cases like this are much harder to find, but where present still leech
performance overhead during modifications. While a number of techniques to
find these kinds of indexes exist , removing unused indexes can provide a huge
performance boost in environments where indexing has gotten out of hand. In
cases where the addition of indexes has been more controlled and deliberate,
you are not typically going to see huge results unless you have a specifically
large index that sees lots of updates.
WHITEPAPER
ABOUT IDERA
Idera provides systems and application management software for Windows
and Linux Servers, including solutions for performance monitoring, backup
and recovery, security and compliance, and server administration. Our market
leading product suites provide 360 degree management solutions for the
Microsoft SQL Server and SharePoint platforms as well as high performance
backup and recovery for server operating systems.
Whether you have ten servers or ten thousand, we give you the best performance
and value with products that are easy to install and deploy and that deliver
real and measurable ROI. Our products are used by over 10,000 companies
Even the basics of index tuning can pay massive dividends when it comes to
increasing SQL Server performance. More importantly, what makes indexes so
powerful is that when correctly employed, they can drastically cut down the
amount of data that SQL Server needs to examine when completing a queryeven
when millions of rows are involved. This in turn means that by effectively using
indexes, you can drastically reduce the demands placed upon your hardware and
do more with the hardware you already have on hand.
WEB
TWITTER
FACEBOOK
LINKEDIN
www.idera.com
www.twitter.com/Idera_Software
www.facebook.com/IderaSoftware
www.linkedin.com/groups?gid=2662613