我有下面的代码..如果我在更新列上创建一个索引,查询会更快吗?
CREATE NONCLUSTERED INDEX tmp ON #TestTable (
jobid,
RecordGroup,
RecordSubGroup,
OpenDate
)
UPDATE #TestTable
SET OpenDate = OB.col1
, OpenWrap = OB.col2
, OpenBalance = OB.col3
FROM #TestTable ST
JOIN JobRecordOut OB ON OB.JobId = ST.JobId
AND OB.RecordGroup = ST.RecordGroup
AND OB.RecordSubGroup = ST.RecordSubGroup
AND OB.RecordType = 'OB'
DROP INDEX tmp ON #TestTable