Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1908

Re: Engine Tuning Advisor recommending non-clustered index on clustered PK columns

X-Received by 10.182.22.138 with SMTP id d10mr34946190obf.37.1429117161373; Wed, 15 Apr 2015 09:59:21 -0700 (PDT)
X-Received by 10.182.104.65 with SMTP id gc1mr194590obb.16.1429117161335; Wed, 15 Apr 2015 09:59:21 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!j5no1818565qga.1!news-out.google.com!a41ni459qgf.1!nntp.google.com!j5no1818556qga.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.databases.ms-sqlserver
Date Wed, 15 Apr 2015 09:59:21 -0700 (PDT)
In-Reply-To <XnsA47CD073FF020Yazorman@127.0.0.1>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=15.219.169.68; posting-account=qJFqbQkAAACYQSLN0-cvP6ydkRfuOu6u
NNTP-Posting-Host 15.219.169.68
References <5b308c23-aca5-4c1f-89c6-3e578aaf2fd1@googlegroups.com> <XnsA47CD073FF020Yazorman@127.0.0.1>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <05e55d7d-09e3-469d-8474-63d4ba8a4431@googlegroups.com> (permalink)
Subject Re: Engine Tuning Advisor recommending non-clustered index on clustered PK columns
From Mark D Powell <markp28665@gmail.com>
Injection-Date Wed, 15 Apr 2015 16:59:21 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Xref csiph.com comp.databases.ms-sqlserver:1908

Show key headers only | View raw


On Tuesday, April 14, 2015 at 2:29:34 PM UTC-4, Erland Sommarskog wrote:
> Mark D Powell (markp28665@gmail.com) writes:
> > A recent Database Engine Tuning Advisor run on a SQL Server 2008 R2 RTM 
> >
> 
> RTM? Please install Service Pack 3 at first possible occasion.
> 
> > system has several recommendations that puzzle me because the
> > recommendation is for a two column non-clustered index on the same two
> > columns that are the clustered PK.  In one case there are only two other
> > columns consuming a total of 5 bytes on the row so I just cannot see any
> > valid reason for this recommendation. 
> 
> One needs to take the recommendations from the Tunig Advisor with a grain
> a salt. Also, a common (ab)use of the advisor is to feed it just a single
> query. The idea is that you should give it a full workload and it tunes
> that workload.
> 
> DETA builds on the missing-index feature in the engine which is very fond
> of recommending covering indexes.
> 
> Say that you in your table with your two-column clustered PK, you have the 
> query like:
> 
>    SELECT pkcol1, MIN(pkcol2)
>    FROM   tbl
>    GROUP  BY pkcol1
> 
> This query will run faster if you add a non-clustered index on the columns, 
> since the leaf pages of the index will be smaller than the leaf pages of the 
> clustered index which have all the other columns.
> 
> Of course, if the other two columns are only five bytes, it is unlikely 
> that this index would be a significant speed booster.
> 
> It is definitely a good thing to review the suggestions from DETA 
> critically.
> 
> -- 
> Erland Sommarskog, Stockholm, esquel@sommarskog.se

Erland, thank you for the reply.  I have always taken the DTA output with a large grain of salt. The missing index feature seems overly fond of include columns and the DTA of indexes in general. I am just trying to understand why if makes some of the recommendations it does so I can justify not applying these specific indexes or identify that the recommendation is in fact valid.

The SP and indeed version level has been raised to management, but as I am only a part-time resource and other full time events have taken priority we will have to see.

Thanks again,
Mark D Powell







    

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Engine Tuning Advisor recommending non-clustered index on clustered PK columns Mark D Powell <markp28665@gmail.com> - 2015-04-14 09:42 -0700
  Re: Engine Tuning Advisor recommending non-clustered index on clustered PK columns Erland Sommarskog <esquel@sommarskog.se> - 2015-04-14 20:29 +0200
    Re: Engine Tuning Advisor recommending non-clustered index on clustered PK columns Mark D Powell <markp28665@gmail.com> - 2015-04-15 09:59 -0700
  Re: Engine Tuning Advisor recommending non-clustered index on clustered PK columns rja.carnegie@gmail.com - 2015-04-15 20:40 -0700

csiph-web