?
Solved

_WA_SYS statistics created - should you index on these as well

Posted on 2006-10-26
2
Medium Priority
?
1,565 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

Assisted Solution

by:Kevin3NF
Kevin3NF earned 600 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 900 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

770 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