add indexes on temp tables