Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Excessive Non-Clustered Index Use?

 
   Database Help (Home) -> General Discussions RSS
Next:  MS SQLS Server 1.2 JDBC Driver - problems  
Author Message
C-Note

External


Since: Jan 15, 2008
Posts: 3



(Msg. 1) Posted: Thu Dec 11, 2008 10:02 am
Post subject: Excessive Non-Clustered Index Use?
Archived from groups: comp>databases>ms-sqlserver (more info?)

I recently started at a new company as their DBA. In looking at their
databases they have indexes that are all non-clustered (including
PK's). There is rarely a clustered index on any of the tables. Can
anyone tell me why you would want to use exclusively non-clustered
indexes on tables? The largest table is >30M records. In my research
you want a clustered index on a table because the non-clustered use
the clustered index.

When I look at the execution plans on these tables table-scans are
constantly done and the non-clustered indexes are not used.

Thoughts? Suggestions?

 >> Stay informed about: Excessive Non-Clustered Index Use? 
Back to top
Login to vote
Erland Sommarskog2

External


Since: May 30, 2004
Posts: 2061



(Msg. 2) Posted: Thu Dec 11, 2008 6:28 pm
Post subject: Re: Excessive Non-Clustered Index Use? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

C-Note ( ) writes:
> I recently started at a new company as their DBA. In looking at their
> databases they have indexes that are all non-clustered (including
> PK's). There is rarely a clustered index on any of the tables. Can
> anyone tell me why you would want to use exclusively non-clustered
> indexes on tables? The largest table is >30M records. In my research
> you want a clustered index on a table because the non-clustered use
> the clustered index.
>
> When I look at the execution plans on these tables table-scans are
> constantly done and the non-clustered indexes are not used.

There are people who believe heaps are the norm, and clsutered indexes
should be avoided. And, indeed, from what I have heard, this is also the
norm on Oracle.

But SQL Server is a different engine, and SQL Server is much more geard
towards clustered indexes, and it does not do a very good job with heaps.
They are more prone to fragmentation, but they are less conventient to
defragment. And while you can get plenty of table scans with clustered
indexes as well, there is at least some probability that the index
organisation can be useful.

The main argument I've heard against clustered indexes, is that since
the CI is used as row locator, a key lookup is more expensive than a
RID lookup. Personally, I don't care too much for that argument. I
think you will have to tune many queries, before any such overhead
is starting to become a concern.



--
Erland Sommarskog, SQL Server MVP, esquel.RemoveThis@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 >> Stay informed about: Excessive Non-Clustered Index Use? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
bulk insert in clustered index table - Hi, I have got the following situation please give me some ideas how to solve/work around it. Current situation: Everyday day about 10 million records are processed and bulk inserted in individual tables. Around 20K records are inserted at a time. At..

Varchar vs Char in 1st field of composite clustered index - Would it be OK to use varchar(5) instead of char(5) as the first field of a composite clustered index? My gut tells me that varchar would be a bad idea, but I am not finding much information on this topic on this when I Google it. Currently the field i...

help plz!!! stored procedure to find index if not found cr.. - can anybody plz....help in a stored procedure..............i basically need a simple stored procedure to see if a index exists in the table if it it doesnot exist i need to create a index for the same table Thanks a lot in advance

Quick SQL Server 7.0 index question - At the moment I only know enough about SQL Server to create the databases I need as a backend for the various internal desktop/web applications I write. I haven't ever had the time to get seriously involved with internal workings of SQL Server and we are...

back up jobs, re-index question - We have a db that is accessed by users on the web 24/7. Problem is when our maintenace job runs users are getting killed with this error: Database Error: SQL Error #-2147217900 [Microsoft][ODBC SQL Server Driver][SQL Server]Transaction manager has..
   Database Help (Home) -> General Discussions All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]