Solved

_WA_SYS statistics created - should you index on these as well

Posted on 2006-10-26
2
1,561 Views
Last Modified: 2008-01-09
We have a number of WA_SYS statistics created (auto on) against tables. Is it wise to create indexes for these fields listed in the WA_SYS if you dont have them setup already. This is a DSS environment.

Thnaks

Paul
0
Comment
Question by:Paul_Blackler
2 Comments
 
LVL 21

Assisted Solution

by:Kevin3NF
Kevin3NF earned 200 total points
ID: 17814211
I wouldn't blindly go create an index just because the system did it.  I would rather do some investigating and (SQL) profiling to see where my perf can be improved and create indexes there if necessary.
0
 
LVL 10

Accepted Solution

by:
AaronAbend earned 300 total points
ID: 17814602
Be careful - statistics are used by the optimizer to choose the path for the query - they are not actually used to execute the query itself.  

A lot of small, low cardinality columns will be scanned by the optimizer and stats will be created. You do not want indexes on these columns because their low cardinality (low number of values) means an index will not help much (imagine a table of states that also includes the country but there is only one value for country - indexing country does not help your query performance).

Check the strategies and base your indexes on what the strategies are doing. If you see time consuming tablescans, definitely create indexes to prevent that from happening.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question