SQL Server Performance Tuning
SQL Server Performance Tuning
Email: [email protected]
General Scaling Options
General Performance Tuning
Indexes
Query Tuning
Procedure Cache Tuning
Understanding Table Sizes
Clustered Indexes
◦ Reorganizes the actual data on disk.
Covered Indexes
◦ Returns query results without accessing the base
table.
◦ Can lead to major performance increases.
◦ Applies to Non-Clustered Indexes.
Contain only the data specified in the index.
Do not change the base layout of the tables.
Use pointers to get to the data.
Can be created on most data types including
char(), varchar(), and uniqueidentifiers.
Only one non-clustered index can be used
per table reference in a query.
Can improve performance with multiple
columns.
Causes base table structure to change.
Only one clustered index per table.
Should never contain char(), varchar(),
varbinary(), uniqueidentifiers, or other large
or widely distributed identifiers.
Can significantly increase the size of a table
and the database.
Can increase performance.
Table Name Rows Disk Space Index Space Total Space
(MB) (MB) (MB)
Table1 2,034,998 450 872 1,322
SELECT qs.execution_count,
st.text, total_elapsed_time
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st
WHERE st.encrypted = 0
ORDER BY st.text
Replace with
Contact Me:
◦ [email protected]