Joining data in the memory with data in the database table