Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 how to see the least selective columns from a dba

Author  Topic 

mara_anda
Starting Member

3 Posts

Posted - 2004-07-28 : 13:20:48
hi,
I have a dba with more than 500 tables and I want to drop the indexes on the least selective columns.
Please help.........thanks

X002548
Not Just a Number

15586 Posts

Posted - 2004-07-28 : 13:34:18
What does that mean?

How big is the DB?

Are inserts taking a long time?

Why/who told you to do this?



Brett

8-)
Go to Top of Page

mara_anda
Starting Member

3 Posts

Posted - 2004-07-28 : 15:31:32
they want to make a performance for the application - one of them was to delete all the indexes on poor selective columns but I don't know how to make this............
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-07-28 : 16:18:14
You could do a
SELECT (COUNT(DISTINCT MyColumn) * 100) / COUNT(*) FROM MyTable
for each column that was indexed to get some idea of the selectivity

Or use
EXEC sp_statistics @table_name = 'MyTable'
to see the Cardinality

Kristen
Go to Top of Page

mara_anda
Starting Member

3 Posts

Posted - 2004-07-28 : 16:30:24
in what range must be Cardinality to be considered a poor index?
Go to Top of Page

Pat Phelan
Posting Yak Master

187 Posts

Posted - 2004-07-28 : 17:03:35
Amazing how these things migrate from one site to another.

-PatP
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-07-29 : 01:31:46
"in what range must be Cardinality to be considered a poor index?"

Well personally I would hand tune any query which performance badly.

But for the experiment you outlined above you could remove the indexes from the bottom quartile, by cardinality, or bottom, say, 10%, and see if it makes a difference.

Kristen
Go to Top of Page
   

- Advertisement -