Improving a search query I have a query for search function.

Basically search function allowed user to define what they "have" and "want". Then this query will filter out all the possible result which created by other user.

For example, I have apple (with good quality) and I want orange (with poor quality). So the result will display all user that have orange (with poor quality) and want apple (with good quality).

The search query a bit long and I try to simplify as below:

This stored procedure will get a user-defined table (ItemID &amp; Quality) as parameter

@WantUdt AS HaveItemUdt READONLY,
@HaveUdt AS HaveItemUdt READONLY


Search query (user can define more than one items and quality, so I use IN):

SELECT * from tbl_Trade WHERE TradeID IN

 (SELECT TradeID from tbl_Want w INNER JOIN

  (SELECT TradeID FROM tbl_Have 
  WHERE HaveID IN (SELECT ItemID FROM @HaveUdt) AND 
  Quality IN (SELECT QualityID FROM @HaveUdt)) as h  --to filter [have], 

 ON w.TradeID = h.TradeID

  WHERE WantID IN (SELECT ItemID FROM @WantUdt) AND 
  Quality =IN (SELECT QualityID FROM @WantUdt)    --to filter [want]
)  


Above query works as expected. However, I am having performance issue. I try do stress test by execute this stored procedure for multiple times within specific time (few seconds), and my SQL Server 2008 Express database seems can't effort and generate a timeout error 


  Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.


I guess it is because the query above use too many IN CLAUSE. 

Is there any way to improve this query?

EDIT

Attached with the actual execution plan and statistic

(1 row(s) affected)
Table '#05C6342A'. Scan count 30813, logical reads 39101, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'tbl_Dota2ItemCustomSchema'. Scan count 14025, logical reads 26490, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'tbl_TradeItemHave'. Scan count 3182, logical reads 6476, physical reads 72, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'tbl_Dota2ItemSchemaExtend'. Scan count 0, logical reads 24134, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'tbl_Dota2ItemSchema'. Scan count 0, logical reads 29132, physical reads 1, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table '#06BA5863'. Scan count 20899, logical reads 28266, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'tbl_TradeItemWant'. Scan count 4456, logical reads 8974, physical reads 42, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'tbl_Trade'. Scan count 1, logical reads 48, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'tbl_UserProfile'. Scan count 1, logical reads 205, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.


Execution Plan Image
The UDT has lot of scans as per the query plan,please try to create UDT with clustered index (primary key)

https://stackoverflow.com/questions/4451052/how-to-add-an-index-or-primary-key-to-a-user-defined-table-type-in-sql-server