James explained it alread.
In order to do a join, the database will have to have access to the data in the tables. If you don't have proper indexes, or you do the 'wrong' query, the database will have to read every record in the joined tables, and it may have to do that several times. If you are low on memory, that can take quite a while...