ここでの問題は、何百万もの行を含む結合が常に最初に来て、その後にのみwhere句が来ることだと思います。代わりにテーブルでこれを試して、メッセージタブでタイムスタンプを確認してください。
declare @t1 table (id int, name nvarchar(100));
declare @t2 table (id int, name nvarchar(100));
insert into @t1 (id, name) values (1, 'a')
insert into @t1 (id, name) values (2, 'b')
insert into @t1 (id, name) values (3, 'c')
insert into @t1 (id, name) values (4, 'd')
insert into @t1 (id, name) values (5, 'e')
insert into @t2 (id, name) values (5, 'e')
insert into @t2 (id, name) values (5, 'f')
insert into @t2 (id, name) values (5, 'g')
insert into @t2 (id, name) values (5, 'h')
insert into @t2 (id, name) values (5, 'i')
insert into @t2 (id, name) values (6, 'j')
insert into @t2 (id, name) values (7, 'k')
insert into @t2 (id, name) values (8, 'l')
print getdate()
-- this is your select statement
select * from @t1 t1 inner join @t2 t2 on t1.id = t2.id where t1.id = 5;
print getdate()
-- this is your select statement
select * from @t1 t1 inner join @t2 t2 on t1.id = t2.id where t2.id = 5;
print getdate()
-- this is done with a WITH to do the filtering beforehand
-- of course, indices will affect the performance a lot
with w2 (id, name) as (select * from @t2 where id = 5)
select * from w2 inner join @t1 t1 on w2.id = t1.id
print getdate()
もちろん、私のサンプルデータを無視して、WITH句のようにテーブルを使用してください。