I\'m joining to a table dozens of different times, and every time, I join (or filter) based on the results of a SUBSTRING of one of the columns (it\'s a string, but left-pad
Add a calculated column to your table and create an index on this column.
ALTER TABLE MyTable Add Column CodeHead As LEFT(Code,Len(Code)-4)
Then create an index on this.
CREATE INDEX CodeHeadIdx ON MyTable.CodeHead