Should I include all of my columns from the one selected in my index?

I have a query that runs it a bit, looks like this.

Select a.ColumnA,a.ColumnB,a.ColumnC,a.CoulmnD,a.columnE,...b.ColumnH
from Table A a
  inner join Table B b
       on a.columnB = b.ColumnB
  Where a.columnA = @VariableA

Now it has a clustered index in table A like this

Clustered Index on ColumnA

It also has a non-clustered index in table A like this

NonClustered Index on (ColumnA,ColumnB) include (ColumnC,ColumnD)

Should I add ColumnsE-G to the index?

+4
source share
1 answer

Check the data type of the columns and parameters being compared in the same way if you see an index scan instead of the expected search in the execution plan.

, SQL Server (, varchar nvarchar). , , , , . .

+2

Source: https://habr.com/ru/post/1584597/


All Articles