what indexes to apply/drop

Plan.pesession (65.6 kB)
avatar image By shama_thakur99 0 asked Jun 06, 2017 at 11:35 AM
more ▼
(comments are locked)
avatar image Aaron Bertrand ♦ Jun 08, 2017 at 12:16 PM

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.

10|10000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 50 attachments (including images) can be used with a maximum of 209.7 MB each and 209.7 MB total.

Follow this question



asked: Jun 06, 2017 at 11:35 AM

Seen: 69 times

Last Updated: Jun 08, 2017 at 12:17 PM