sql - Better to use a Clustered index or a Non-Clustered index with included columns? -


When I look at the execution plan for a particular query, I think 77% of my cost is in the package index

Is it the fact that I am using a compiled index, does that mean that I will not be able to see the performance issues due to the columns that are outputting?

Would it be better for me to include a non-clustered version of this and include all the columns that are outputting?

UPDATE: The package indicator uses a composite key, not sure that it does not matter.

The reasons you use include a column on a non-cluster index in the cluster data " The thing to avoid "bookmark-lookup" is that if SQL Server can theoretically use a specific non-cluster based index, but the Optimizer estimates that there are so many bookmarks-lookups The index will be ignored. However, if all the selected columns are accessible directly from the index, no bookmark-lookup will be required.

In your case, the fact that you are reaching data through "looking for clustered index" is very promising, it will be very difficult to improve its performance, including a non-package index A little may be sharp, but only because the raw data is slightly

However, you should check the extension ...

  • If you are using an aggregate key and you In and only at the beginning of the key, so you may not be lucky enough to find that you can only be limited to 500,000 rows and then he is doing a search on the basis of other criteria. Experiment with some non-cluster indexes in this case.
  • The search for a clustered index can be cured itself; But if this is being done 100,000 times in your query because some other aspects are returning too many inorganic rows - then you will not get much by improving the functionality of the package index.

Finally, to expand on Davek's comment: "Cost is relative" simply because your cluster cost cluster is 77% does not mean that there is a problem. A trivial 1 table query that returns a sinlge line and it is possible to write in the search index cost at 100% (but of course, only 'work' is being done, it will be be 100 % Work ... and 100% Quick Now Instant . Therefore: "Do not worry, be happy!"


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -