Quick fix to optimize out temp table for simple aggs