Query to get data from 2 different tables is taking long time
Rewrite your query such a way:

SELECT Column1, 
       Column2,
       etc..
FROM Db1.dbo.Tb1 b
WHERE EXISTS (
        SELECT TOP (1) 1
        FROM Db2.dbo.Tb2 s
        WHERE s.Id2 &lt;&gt; ''
            AND b.Id1 IN (s.Column3, s.Column4)
    )