what indexes to apply/drop

shama_thakur99 2017-06-06 11:35:05

Aaron Bertrand 2017-06-08 12:16:00
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.