• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

Execution Plan/ Client Statistics

The Execution Plan/ Client Statistics for this query prior to indexing is shown on the attached image:
select s.[year], a.AnalyteCode, a.Analyte
, Min(a.ConcentrationLevel) as min_Concentration_Level
, Max(a.ConcentrationLevel) as max_Concentration_Level
, a.ConcentrationLevelUnit as Concentration_Unit
from LabAnalyteData as a inner join 
LabSampleData as s on s.IDinAccess= a.IDinAccess
Group By s.[year], a.AnalyteCode, a.Analyte, a.ConcentrationLevelUnit
Order By a.Analyte

Open in new window

On this image, under Execution Plan tab, there is indexing recommendation in green.
Question 1: Is there a way to copy and paste the string of this recommendation?

The list of missing non-clustered indexes are:
- a.IDinAccess  (FK)
- Include a.AnalyteCode, a.Analyte, a.ConcentrationLevelUnit

Question 2: What exactly does the above recommendation mean? Which of the following it is recommending:

CREATE INDEX index_FK_IDinAccess_LabAnalyteData ONLabAnalyteData (IDinAccess);    
CREATE INDEX index_FK_Fields_LabAnalyteData ONLabAnalyteData (AnalyteCode, Analyte, ConcentrationLevelUnit);

or:

CREATE INDEX index_FK_IDinAccess_LabAnalyteData ONLabAnalyteData (IDinAccess, AnalyteCode, Analyte, ConcentrationLevelUnit);

Question 3: What red flags do you see on the Execution Plan/ Client Statistics tabs?
IndexAnalizer-1.png
0
Mike Eghtebas
Asked:
Mike Eghtebas
  • 2
  • 2
1 Solution
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Question 1: Is there a way to copy and paste the string of this recommendation?
Double click on the recommendation index (green text).

Question 2: What exactly does the above recommendation mean? Which of the following it is recommending:
None. The create index key is there (green text). Recommendation is to create an index on IDinAccess and include the rest of the fields so the engine doesn't need to access the main table to return those values.

Question 3: What red flags do you see on the Execution Plan/ Client Statistics tabs?
The ORDER BY clause is spending 83% of the process.
0
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
re:> Double click on the recommendation index (green text).

This doesn't work maybe because I am using Express version.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Can't test on Express edition because I don't have one.
Did you try right-click on it to see the available options?
0
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
Yes I did. It must be the difference in Express version.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now