You have a simple "select all columns from all rows in this table" - no indexes are going to help satisfy that query better. You are literally telling SQL Server to just read the whole thing and return it all in any arbitrary order. Indexes are used to reduce the amount of I/O you have to do - they typically include only a subset of the columns and can help you eliminate rows, either by leading with key columns that you can identify directly (like from dbo.Sales WHERE CustomerID = x) or with a built-in filter (like from dbo.Customers WHERE Active = 1), or to support sorting (for display or for grouping or applying aggregates). I can't even begin to offer any advice here unless you include some plans that demonstrate queries you actually run and that are useful to your application.
from dbo.Sales WHERE CustomerID = x
from dbo.Customers WHERE Active = 1
Up to 50 attachments (including images) can be used with a maximum of 209.7 MB each and 209.7 MB total.
Answers and Comments
query plan x676
plan explorer upload x489
clustered index x25
asked: Jun 06, 2017 at 11:35 AM
Seen: 69 times
Last Updated: Jun 08, 2017 at 12:17 PM
SQL Server execution plan is using PK instead of index
How can I further optimise this query?
Any way to speed up a PK?
How can I get an Index Seek on this PK CLUSTERED index?
Wrong index scan
Help with removing the sort form the plan
possible to get MAX() with only an index scan?
Difficulty finding covering index for this
this query is taking too long, any ideas how to improve performance with indexes
The query takes a long time to run, looking for options to try and get it to run faster based on this plan?
© 2013 SQL Sentry, Inc. All rights reserved.