Since you using a linked server and also you are string comparisons, I am pretty sure your slow performance is because SQL Server has to bring the whole Product table from the DB2 database to a local copy, then compare the strings according to your current collation settings. You see, comparing strings may have different results on different collation settings, and on different database systems. When linking between Microsoft SQL Servers databases you can enable Collation compatibility so when the query is executed it will trust the linked server decision about string comparison and sorting. I don't know if collation compatibility is possible between Microsoft SQL Server and DB2. So the solution to the problem will be to use OPENROWSET instead of a linked server.
Something like this:
SELECT * FROM OPENROWSET
('DB2OLEDB',Netlib=SNA;NetAddr=;NetPort=;RemoteLU=OLYMPIA;LocalLU=LOCAL;ModeName=QPCSUPP;User ID=WNW3XX;Password=WNW3XX;InitCat=OLYMPIA;Default Schema=WNW3XX;PkgCol=WNW3XX;TPName=;Commit=YES;IsoLvl=NC;AccMode=;CCSID=37;PCCodePage=1252;BinAsChar=NO;Data Source=Sample',
'SELECT SUM(Qty)
FROM Products
WHERE Type = ''SODA''
AND (Code LIKE ''A5%''
OR Code IN(''DHA2'',''JHU8'',''KML2'',''LQA1'',''ZSX2'')) ' )
See more info in linked server to DB2 using Microsoft OLE DB provider for DB2
And in OPENROWSET (Transact-SQL)
CREATE NONCLUSTERED INDEX IX_Products_Code ON Products (Code) INCLUDE (Qty) WHERE Type = 'SODA'- However that index is geared entirely towards this query, and probably not much help on your other queries.