This is why a nested loop is not going to work here... 20,000 squared operations is very expensive, let alone millions squared. For a query withthis profile, the inner query should only be executed once.
Perhaps you can get the behavior you desire by explicitly creating a temporary table, selecting the data from your inner query into the temporary table, then re-writing your main query to join against the temporary table? thanks, bryan