when you use a function (substring, ltrim, rtrim, dateadd, etc) on a column in the join or where clause, that value can not be used to index, a scan is done. if the other columns are not very selective, this will cause a table scan and slow the query.
outer joins are typically slow as its all rows not matching the join.
note: you should clean up your data and not require trim operations.