create table #testing(id int, name varchar(50))
go
Insert Into #testing
Values(231, 'fasd')
Insert Into #testing
Values(232, 'dsffd')
Insert Into #testing
Values(233, 'xas')
Insert Into #testing
Values(234, 'asdasd')
create table #testing2(id int, name varchar(50))
go
Insert Into #testing(id)
Values(231)
Insert Into #testing(id)
Values(232)
Insert Into #testing(id)
Values(233)
Insert Into #testing(id)
Values(234)
go
update m
set name = x.name
from #testing2 m
join #testing x
on m.id = x.id
Where m.name is null
Without an index on #testing and #testing2
index on id column on both #testing and #testing2
index is
create nonclustered index ix_test1 on #testing1(id) include (name)
create nonclustered index ix_test1 on #testing2(id)
What would be the best possible index on this situation? Is it right to not have an index on #testing(name) because the write/update would be slower?