Question About Indexes

I have a few questions about indexing a large table.  I right-clicked and clicked New Index.  I added Indexes to my Date field, as well as a few other stock identifiers.  So, I indexed 5 'Index Key Columns'.  Should I also select the 5 corresponding 'Included Columns'?  When I highlighted the query and clicked 'Display Estimated Execution Plan', it says 'Missing Index Details from SQLQuery23.sql'  I JUST ADDED IT!  I don't understand this comment.

Can someone please give me a point in the right direction with this stuff?

Th

February 17th, 2015 6:55pm

Designing indexes can be easy but it can also be very tricky as proper index design can depend on many factors. It would help if we know more about your table schema, the query that is being executed, and the query plan that is generated by Microsoft Sql Server. Another thing I recommend is to run the following before you execute the query and be sure to turn on Display Actual Execution Plan instead of just the estimated execution plan in Sql Server Management Studio.

-- do not run this on the live server, use this for testing only

SET STATISTICS IO ON GO dbcc freeproccache GO dbcc dropcleanbuffers GO

These statements will

  • Display additional output
  • Clear the plan cache
  • Clears cached results from memory

This way you get a better picture of the impact of the query in your environment.

Below are some resources that can guide you in designing an index:

SQL Server Index Design Guide

How To: Optimize SQL Indexes

Free Windows Admin Tool Kit Click here and download it now
February 17th, 2015 8:25pm

Good day ryguy72,

In order to help you, we need lot more information. Choosing the best indexes might be very complex, since it depend on your specific basic table structure, and the way you use the data (any query that use the data, any relations between tables, etc'). as a starting point please post this information:

1. the table basic structure (columns, current indexes, and constraints)

2. all queries that should use the data, and try to estimate how much you use each of them (index that improve one query might slowdown another query)

3. basic story on the interface (the way you use the

February 17th, 2015 8:34pm

  So, I indexed 5 'Index Key Columns'.  Should I also select the 5 corresponding 'Included Columns'?  When I highlighted the query and clicked 'Display Estimated Execution Plan', it says 'Missing Index Details from SQLQuery23.sql'  I JUST ADDED IT!  I don't understand this comment.

Unless you post the execution plan showing missing index and query we cannot say with sureity. SQL Server had bug where even after creating index it gave message in execution plan as missing index but what is your scenario can only be understood after complete details are posted
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 12:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics