sql - Should I include all of my columns from the select in my index? -


i have query taking bit run looks this.

select a.columna,a.columnb,a.columnc,a.coulmnd,a.columne,...b.columnh table a   inner join table b b        on a.columnb = b.columnb   a.columna = @variablea 

now has clustered index on table this

clustered index on columna 

it has nonclustered index on table this

nonclustered index on (columna,columnb) include (columnc,columnd) 

should add columnse-g index well?

verify data type of compared columns , parameters same when see index scan instead of expected seek in execution plan.

when data types differ, sql server must first convert operand lower precedence higher precedence data type (e.g. varchar nvarchar). when column value must converted, conversion prevents index on column being used efficiently because column value of each row must converted before comparison can done. known non-sargable expression , prevents more efficient index seek.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -